| Task: | Hamilton |
| Sender: | Lia_Cruz |
| Submission time: | 2026-04-17 11:43:12 +0300 |
| Language: | C++ (C++20) |
| Status: | READY |
| Result: | 5 |
| subtask | verdict | score |
|---|---|---|
| #1 | ACCEPTED | 5 |
| #2 | WRONG ANSWER | 0 |
| #3 | WRONG ANSWER | 0 |
| #4 | WRONG ANSWER | 0 |
| test | verdict | time | score | subtask | |
|---|---|---|---|---|---|
| #1 | WRONG ANSWER | 0.01 s | 0 | details | |
| #2 | ACCEPTED | 0.04 s | 100 | 1 | details |
| #3 | WRONG ANSWER | 0.01 s | 0 | 2, 3 | details |
| #4 | WRONG ANSWER | 0.01 s | 0 | 4 | details |
Code
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define F first
#define S second
#define pb push_back
#define vi vector<int>
#define pii pair<int, int>
#define vvi vector<vector<int>>
#define sz(x) x.size()
#define all(x) (x).begin(), x.end()
#define rall(x) (x).rbegin(), (x).rend()
const int INF = 1e18;
int32_t main(){
cin.tie(0) -> sync_with_stdio(0);
cout.tie(0); cout<<fixed;
int n, t;
cin>>n>>t;
vector<string> g = {
"0110",
"0011",
"0001",
"1000"
};
for(auto x : g){
cout<<x<<endl;
}
while(t--){
vector<vector<bool>> b(5, vector<bool> (5));
for(int i = 1; 4 >= i; i++){
for(int j = i + 1; 4 >= j; j++){
cout<<"? "<<i<<" "<<j<<endl;
char c; cin>>c;
if(c == '>'){
b[i][j] = 1;
}
else{
b[j][i] = 1;
}
}
}
vi p = {1, 2, 3, 4};
do{
bool ok = 1;
for(int i = 0; 3 > i; i++){
if(!b[p[i]][p[i + 1]]){
ok = 0;
}
}
if(!b[p[3]][p[0]]){
ok = 0;
}
if(ok){
cout<<"! ";
for(int i = 0; 4 > i; i++){
cout<<p[i]<<" ";
}
cout<<endl;
break;
}
}while(next_permutation(all(p)));
}
return 0;
}Test details
Test 1
Subtask:
Verdict: WRONG ANSWER
| 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: ACCEPTED
| input |
|---|
| 01 4 200 rnd |
| correct output |
|---|
| (empty) |
| user output |
|---|
| Activating encoder mode 4 200 0110 0011 0001 ... |
Feedback: Q = 6.000000
Test 3
Subtask: 2, 3
Verdict: WRONG ANSWER
| input |
|---|
| 02 50 200 rnd |
| correct output |
|---|
| (empty) |
| user output |
|---|
| Activating encoder mode 50 200 0110 0011 0001 ... |
Feedback: Invalid character in graph description63.
Test 4
Subtask: 4
Verdict: WRONG ANSWER
| input |
|---|
| 03 500 200 rnd |
| correct output |
|---|
| (empty) |
| user output |
|---|
| Activating encoder mode 500 200 0110 0011 0001 ... |
Feedback: Invalid character in graph description63.
