Submission details
Task:Hamilton
Sender:jsesok
Submission time:2026-08-24 18:34:16 +0300
Language:C++ (C++23)
Status:READY
Result:0
Feedback
subtaskverdictscore
#10
#20
#30
#40
Test results
testverdicttimescoresubtask
#10.01 s0details
#20.01 s01details
#30.01 s02, 3details
#40.01 s04details

Code

#include <iostream>
#include <numeric>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <queue>
using namespace std;
int main() {
  /*  ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(0);*/
    int n, t, zn;
    char c;
    cin>>n>>t;
    cout<<"0110\n"<<"0011\n"<<"0001\n"<<"1000"<<endl;
    for (int i=0; i<t; ++i)
    {
        vector<int> next={0, 1, 2, 3};
        vector<vector<int>> g(n, vector<int> (n, 0));
        for (int i=0; i<n; ++i)
        {
            for (int j=i+1; j<n; ++j)
            {
                cout<<i+1<<" "<<j+1<<endl;
                cin>>c;
                if (c=='>')
                {
                    g[i][j]=1;
                }
                else
                {
                    g[j][i]=1;
                }
            }
        }
        do
        {
            zn=1;
            for (int i=0; i<n; ++i)
            {
                if (g[next[i]][next[(i+1)%n]]==0)
                {
                    zn=0;
                    break;
                }
            }
            if (zn==1)
            {
                cout<<"!";
                for (int i : next)
                    cout<<" "<<i+1;
                cout<<endl;
                break;
            }
        }while (next_permutation(next.begin(), next.end()));
    }
    return 0;
}

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
0110
0011
0001
...

Feedback: Self-loop

Test 2

Subtask: 1

Verdict:

input
01 4 200 rnd

correct output
(empty)

user output
Activating encoder mode
4 200
0110
0011
0001
...

Feedback: Case #1: Unexpected operation

Test 3

Subtask: 2, 3

Verdict:

input
02 50 200 rnd

correct output
(empty)

user output
Activating encoder mode
50 200
0110
0011
0001
...

Feedback: Invalid character in graph description50.

Test 4

Subtask: 4

Verdict:

input
03 500 200 rnd

correct output
(empty)

user output
Activating encoder mode
500 200
0110
0011
0001
...

Feedback: Invalid character in graph description50.