#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using db = double;
#define pb push_back
#define sz(vec) ((ll)vec.size())
#define all(vec) vec.begin(), vec.end()
#define f first
#define s second
const int MOD = 1e9 + 7;
const ll BIGINF = ((ll)1e18) + 7;
#define Speeed ios::sync_with_stdio(0);cin.tie(NULL); cout.tie(NULL);
int main(){
ll n, col = 1, old = 0;
cin>>n;
vector<ll> ans(n+1);
// map<ll, bool> newcol;
// set<ll> sett;
vector<ll> newcol;
for(ll i = 1; i <= n; i++){
cout<<i<<" ";
for(ll j = 1; j <= i; j++){
cout<<j<<" ";
}
cout<<endl;
ll x;
cin>>x;
if(x!=old){
ans[i] = col;
col++;
newcol.pb(i);
}
old = x;
}
for(ll i = 1; i <= n; i++){
if(ans[i])continue;
for(auto y: newcol){
if(y >= i)break;
cout<<"2 "<<y<<" "<<i<<endl;
ll x;
cin>>x;
if(x==1){
ans[i] = ans[y];
break;
}
}
}
cout<<"0 ";
for(ll i = 1; i <= n; i++)cout<<ans[i]<<" ";
cout<<endl;
return 0;
// 1 3 1
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
10 ms |
208 KB |
Output is correct |
2 |
Correct |
18 ms |
208 KB |
Output is correct |
3 |
Correct |
12 ms |
208 KB |
Output is correct |
4 |
Correct |
5 ms |
208 KB |
Output is correct |
5 |
Correct |
4 ms |
208 KB |
Output is correct |
6 |
Correct |
4 ms |
208 KB |
Output is correct |
7 |
Correct |
10 ms |
208 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
208 KB |
Output is correct |
2 |
Correct |
25 ms |
208 KB |
Output is correct |
3 |
Correct |
10 ms |
208 KB |
Output is correct |
4 |
Correct |
10 ms |
208 KB |
Output is correct |
5 |
Correct |
6 ms |
208 KB |
Output is correct |
6 |
Correct |
7 ms |
208 KB |
Output is correct |
7 |
Correct |
9 ms |
208 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
208 KB |
Output is correct |
2 |
Correct |
7 ms |
208 KB |
Output is correct |
3 |
Correct |
23 ms |
300 KB |
Output is correct |
4 |
Correct |
6 ms |
300 KB |
Output is correct |
5 |
Correct |
4 ms |
208 KB |
Output is correct |
6 |
Correct |
4 ms |
208 KB |
Output is correct |
7 |
Correct |
19 ms |
300 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
208 KB |
Output is correct |
2 |
Correct |
4 ms |
208 KB |
Output is correct |
3 |
Correct |
13 ms |
208 KB |
Output is correct |
4 |
Correct |
6 ms |
208 KB |
Output is correct |
5 |
Correct |
4 ms |
208 KB |
Output is correct |
6 |
Correct |
9 ms |
300 KB |
Output is correct |
7 |
Correct |
12 ms |
208 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
7 ms |
208 KB |
Output is correct |
2 |
Correct |
15 ms |
208 KB |
Output is correct |
3 |
Correct |
8 ms |
300 KB |
Output is correct |
4 |
Correct |
17 ms |
208 KB |
Output is correct |
5 |
Correct |
6 ms |
208 KB |
Output is correct |
6 |
Correct |
3 ms |
208 KB |
Output is correct |
7 |
Correct |
6 ms |
208 KB |
Output is correct |