Submission details
Task:Hamilton
Sender:AKurlavicius
Submission time:2026-04-17 14:44:14 +0300
Language:C++ (C++20)
Status:READY
Result:0
Feedback
subtaskverdictscore
#10
#20
#30
#40
Test results
testverdicttimescoresubtask
#10.01 s0details
#20.01 s01details
#30.01 s02, 3details
#40.04 s04details

Compiler report

input/code.cpp: In function 'void slv()':
input/code.cpp:14:22: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   14 |     while (ans.size()<n)
      |            ~~~~~~~~~~^~

Code

#include <bits/stdc++.h>
using namespace std;

int n, t;

int arr[501][501];

void slv()
{
    vector<bool> lank(501);
    vector<int> ans;
    ans.push_back(1);
    lank[1]=1;
    while (ans.size()<n)
    {
        for (int i=1; i<=n; i++)
            if (!lank[i])
            {
                cout<<"? "<<ans.back()<<' '<<i<<endl;
                char in;
                cin>>in;
                if (in=='>')
                {
                    ans.push_back(i);
                    lank[i]=1;
                    break;
                }
            }
    }
    cout<<'!';
    for (int i:ans)
        cout<<' '<<i;
}

int main()
{
    cin>>n>>t;
    for (int i=1; i<=n; i++)
        arr[i][i%n+1]=1;
    for (int i=1; i<=n; i++)
    {
        for (int j=1; j<=n; j++)
            cout<<arr[i][j];
        cout<<endl;
    }
    while (t--)
        slv();
}

Test details

Test 1

Subtask:

Verdict:

input
0 5 2 fixed 1 2 3 4 5 2 4 1 5 ...

correct output
(empty)

user output
Activating encoder mode
5 2
01000
00100
00010
...

Feedback: Duplicate or missing edge in given graph

Test 2

Subtask: 1

Verdict:

input
01 4 200 rnd

correct output
(empty)

user output
Activating encoder mode
4 200
0100
0010
0001
...

Feedback: Duplicate or missing edge in given graph

Test 3

Subtask: 2, 3

Verdict:

input
02 50 200 rnd

correct output
(empty)

user output
Activating encoder mode
50 200
010000000000000000000000000000...

Feedback: Duplicate or missing edge in given graph

Test 4

Subtask: 4

Verdict:

input
03 500 200 rnd

correct output
(empty)

user output
Activating encoder mode
500 200
010000000000000000000000000000...

Feedback: Duplicate or missing edge in given graph