Submission details
Task:Hamilton
Sender:RJuknevicius
Submission time:2026-04-17 12:24:16 +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.18 s04details

Code

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


bool compare(int a, int b)
{
    cout << "? " << a << " " << b << endl;
    char x;cin>>x;
    return (x=='<');
}
int main()
{
    int n,t;cin>>n>>t;

    for(int i =0;i<n;i++)
    {
        for(int j=0;j<n;j++)
        {
            if(i==n-1 && j==0) cout << 1;
            else if(j-i>0 && j-i<n-1) cout << 1;
            else cout << 0;
            cout << " ";
        }
        cout <<endl;
    }

    for(int k = 0; k < t; k++)
    {
        vector<int> a;
        for(int i = 0; i<n;i++)
        {
             a.push_back(i+1);
        }
        stable_sort(a.begin(), a.end(), compare);

        cout << "! ";
        for(int i = 0; i<n;i++)
        {
            cout << a[i] << " ";
        }
        cout << endl;
    }
}

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
0 1 1 1 0 
0 0 1 1 1 
0 0 0 1 1 
...

Feedback: Case #1: Wrong edge in answer, 5 to 4

Test 2

Subtask: 1

Verdict:

input
01 4 200 rnd

correct output
(empty)

user output
Activating encoder mode
4 200
0 1 1 0 
0 0 1 1 
0 0 0 1 
...

Feedback: Case #1: Wrong edge in answer, 1 to 4

Test 3

Subtask: 2, 3

Verdict:

input
02 50 200 rnd

correct output
(empty)

user output
Activating encoder mode
50 200
0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

Feedback: Case #1: Wrong edge in answer, 28 to 27

Test 4

Subtask: 4

Verdict:

input
03 500 200 rnd

correct output
(empty)

user output
Activating encoder mode
500 200
0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

Feedback: Case #1: Wrong edge in answer, 395 to 101