#include "bits/stdc++.h"
using namespace std;
#define ln "\n"
#define pb push_back
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
#define int long long
const int MOD = 1e9 + 7;
const int inf = 2e18;
signed main() {
cin.tie(0) -> sync_with_stdio(0);
int n; cin >> n;
int C = 0;
cout << n << ' ';
for(int i = 1; i <= n; i++) cout << i << ' ';
cout << endl;
cin >> C;
vector<int> cur;
vector<int> nxt;
vector<int> ans(n + 1, 0);
for(int i = 1; i <= n; i++) {
int c;
if(i != n) {
cout << n - i << ' ';
for(int j = i + 1; j <= n; j++) cout << j << ' ';
cout << endl;
cin >> c;
} else {
c = 0;
}
if(c < C) {
ans[i] = C;
for(int x : cur) {
cout << 2 << ' ' << i << ' ' << x << endl;
int y; cin >> y;
if(y != 1) {
nxt.pb(x);
} else {
ans[x] = C;
}
}
swap(cur, nxt);
vector<int>(0).swap(nxt);
C--;
} else cur.pb(i);
}
cout << 0 << ' ';
for(int i = 1; i <= n; i++) cout << ans[i] << ' ';
cout << endl;
cerr << "\nTime: " << clock() * 1000 / CLOCKS_PER_SEC;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
19 ms |
444 KB |
Output is correct |
2 |
Correct |
23 ms |
444 KB |
Output is correct |
3 |
Correct |
16 ms |
336 KB |
Output is correct |
4 |
Correct |
9 ms |
336 KB |
Output is correct |
5 |
Correct |
9 ms |
460 KB |
Output is correct |
6 |
Correct |
5 ms |
336 KB |
Output is correct |
7 |
Correct |
35 ms |
448 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
10 ms |
456 KB |
Output is correct |
2 |
Correct |
26 ms |
444 KB |
Output is correct |
3 |
Correct |
10 ms |
336 KB |
Output is correct |
4 |
Correct |
11 ms |
444 KB |
Output is correct |
5 |
Correct |
16 ms |
592 KB |
Output is correct |
6 |
Correct |
20 ms |
504 KB |
Output is correct |
7 |
Correct |
17 ms |
336 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
456 KB |
Output is correct |
2 |
Correct |
12 ms |
592 KB |
Output is correct |
3 |
Correct |
24 ms |
452 KB |
Output is correct |
4 |
Correct |
7 ms |
336 KB |
Output is correct |
5 |
Correct |
37 ms |
448 KB |
Output is correct |
6 |
Correct |
39 ms |
452 KB |
Output is correct |
7 |
Correct |
44 ms |
452 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
7 ms |
336 KB |
Output is correct |
2 |
Correct |
11 ms |
460 KB |
Output is correct |
3 |
Correct |
21 ms |
448 KB |
Output is correct |
4 |
Correct |
4 ms |
336 KB |
Output is correct |
5 |
Correct |
42 ms |
448 KB |
Output is correct |
6 |
Correct |
47 ms |
444 KB |
Output is correct |
7 |
Correct |
31 ms |
444 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
460 KB |
Output is correct |
2 |
Correct |
19 ms |
336 KB |
Output is correct |
3 |
Correct |
25 ms |
448 KB |
Output is correct |
4 |
Correct |
32 ms |
336 KB |
Output is correct |
5 |
Correct |
36 ms |
584 KB |
Output is correct |
6 |
Correct |
37 ms |
700 KB |
Output is correct |
7 |
Correct |
10 ms |
452 KB |
Output is correct |