This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
const int mxN = 157;
int ans[mxN];
int32_t main() {
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int n;
cin >> n;
int cur = 1;
for (int i = 1; i <= n; ++i) {
if (!ans[i]) {
ans[i] = cur++;
for (int j = i + 1; j <= n; ++j) {
if (!ans[j]) {
cout << "2 " << i << ' ' << j << endl;
int num;
cin >> num;
if (num == 1) {
ans[j] = ans[i];
}
}
}
}
}
cout << "0 ";
for (int i = 1; i <= n; ++i) {
cout << ans[i] << ' ';
}
cout << endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |