#include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
int main() {
cin.tie(0)->sync_with_stdio(0);
cin.exceptions(cin.failbit);
int N;
cin >> N;
vi col(N);
int C = 1;
rep(i,0,N) {
col[i] = C;
rep(j,0,i) {
cout << 2 << " " << (i + 1) << " " << (j + 1) << endl;
int num;
cin >> num;
if (num == 1) {
col[i] = col[j];
break;
}
}
if (col[i] == C) ++C;
}
cout << 0;
rep(i,0,N) cout << " " << col[i];
cout << endl;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
344 KB |
Output is correct |
2 |
Partially correct |
22 ms |
344 KB |
Partially correct |
3 |
Partially correct |
43 ms |
344 KB |
Partially correct |
4 |
Partially correct |
50 ms |
344 KB |
Partially correct |
5 |
Correct |
2 ms |
596 KB |
Output is correct |
6 |
Correct |
1 ms |
344 KB |
Output is correct |
7 |
Partially correct |
15 ms |
344 KB |
Partially correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
344 KB |
Output is correct |
2 |
Correct |
16 ms |
344 KB |
Output is correct |
3 |
Partially correct |
29 ms |
344 KB |
Partially correct |
4 |
Partially correct |
39 ms |
344 KB |
Partially correct |
5 |
Correct |
5 ms |
344 KB |
Output is correct |
6 |
Correct |
5 ms |
344 KB |
Output is correct |
7 |
Correct |
8 ms |
344 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
5 ms |
344 KB |
Output is correct |
3 |
Partially correct |
19 ms |
344 KB |
Partially correct |
4 |
Partially correct |
42 ms |
344 KB |
Partially correct |
5 |
Correct |
14 ms |
344 KB |
Output is correct |
6 |
Correct |
14 ms |
344 KB |
Output is correct |
7 |
Partially correct |
19 ms |
344 KB |
Partially correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
344 KB |
Output is correct |
2 |
Correct |
3 ms |
344 KB |
Output is correct |
3 |
Partially correct |
43 ms |
356 KB |
Partially correct |
4 |
Partially correct |
60 ms |
344 KB |
Partially correct |
5 |
Correct |
18 ms |
344 KB |
Output is correct |
6 |
Partially correct |
26 ms |
344 KB |
Partially correct |
7 |
Partially correct |
18 ms |
344 KB |
Partially correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
9 ms |
344 KB |
Output is correct |
3 |
Partially correct |
35 ms |
344 KB |
Partially correct |
4 |
Partially correct |
42 ms |
344 KB |
Partially correct |
5 |
Partially correct |
22 ms |
344 KB |
Partially correct |
6 |
Partially correct |
30 ms |
344 KB |
Partially correct |
7 |
Partially correct |
47 ms |
344 KB |
Partially correct |