#include <bits/stdc++.h>
typedef long long ll;
#define FOR(i,x,y) for(ll i=x; i<y; i++)
#define FORNEG(i,x,y) for(ll i=x; i>y; i--)
using namespace std;
int main(){
ll n;
cin >> n;
ll c;
cout<< n << " ";
FOR(i,1,n+1) cout << i << " " ;
cout << endl;
cin >> c;
vector<vector<ll>> tings(c);
set<ll> sussy;
ll prev = c;
FORNEG(i,n-1,0){
ll sus = 0;
cout << i << " ";
FOR(j,1,i+1){
cout << j << " ";
}
cout << endl;
cin >> sus;
if (sus != prev){
sussy.insert(i+1);
tings[c-prev].push_back(i+1);
prev = sus;
}
}
tings[c-1].push_back(1);
sussy.insert(1);
FOR(i,0,c){
FOR(j,1,n+1){
if (!sussy.count(j)){
cout << 2 << " " << tings[i][0] << " " << j << endl;
ll realsus;
cin >> realsus;
if (realsus==1){
tings[i].push_back(j);
sussy.insert(j);
}
}
}
}
vector<ll> ans(n+1);
FOR(i,0,c){
for (auto&j : tings[i]){
ans[j-1] = i+1;
}
}
cout << 0 << " ";
for (auto&i : ans){
cout << i << " ";
}
cout << endl;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
304 KB |
Output is correct |
2 |
Correct |
19 ms |
208 KB |
Output is correct |
3 |
Correct |
23 ms |
304 KB |
Output is correct |
4 |
Correct |
9 ms |
308 KB |
Output is correct |
5 |
Correct |
5 ms |
300 KB |
Output is correct |
6 |
Correct |
5 ms |
356 KB |
Output is correct |
7 |
Correct |
24 ms |
300 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
300 KB |
Output is correct |
2 |
Correct |
16 ms |
288 KB |
Output is correct |
3 |
Correct |
15 ms |
292 KB |
Output is correct |
4 |
Correct |
9 ms |
208 KB |
Output is correct |
5 |
Correct |
19 ms |
208 KB |
Output is correct |
6 |
Correct |
22 ms |
280 KB |
Output is correct |
7 |
Correct |
19 ms |
208 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
336 KB |
Output is correct |
2 |
Correct |
7 ms |
304 KB |
Output is correct |
3 |
Correct |
23 ms |
208 KB |
Output is correct |
4 |
Correct |
8 ms |
300 KB |
Output is correct |
5 |
Partially correct |
35 ms |
296 KB |
Partially correct |
6 |
Partially correct |
34 ms |
284 KB |
Partially correct |
7 |
Correct |
27 ms |
208 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
304 KB |
Output is correct |
2 |
Correct |
9 ms |
336 KB |
Output is correct |
3 |
Correct |
19 ms |
304 KB |
Output is correct |
4 |
Correct |
6 ms |
208 KB |
Output is correct |
5 |
Partially correct |
35 ms |
300 KB |
Partially correct |
6 |
Partially correct |
43 ms |
288 KB |
Partially correct |
7 |
Correct |
27 ms |
208 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
6 ms |
300 KB |
Output is correct |
2 |
Correct |
13 ms |
300 KB |
Output is correct |
3 |
Partially correct |
39 ms |
336 KB |
Partially correct |
4 |
Correct |
27 ms |
304 KB |
Output is correct |
5 |
Partially correct |
37 ms |
296 KB |
Partially correct |
6 |
Partially correct |
36 ms |
208 KB |
Partially correct |
7 |
Correct |
9 ms |
208 KB |
Output is correct |