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>
//#include <fstream>
///#define endl '\n'
#define mod 10007
#define INF 100000000
#define ll long long
//ofstream fout("split.out");
//ifstream fin("split.in");
//#define cin fin
//#define cout fout
using namespace std;
int main()
{
ios_base::sync_with_stdio(0);cout.tie(0);cin.tie(0);
int n; cin >> n;
int ans[n+1] = {};
int cnt = 1;
for(int i = 1; i <= n; i++)
{
if(ans[i] != 0)
continue;
ans[i] = cnt;
cnt++;
for(int j = i+1; j <= n; j++)
{
int x;
cout << 2 << ' ' << i << ' ' << j << endl;
cin >> x;
if(x == 1)
{
ans[j] = ans[i];
}
}
}
cout << 0 << ' ';
for(int i = 1; i <= n; i++)
{
cout << ans[i] << ' ';
}
cout << endl;
return 0;
}
# | 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... |