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;
#define endl '\n'
#define int long long
#define all(pr1) pr1.begin(),pr1.end()
#define alr(pr1) pr1.rbegin(),pr1.rend()
#define CEIL(pr1, pr2) (pr1 + pr2 - 1) / pr2
#define IOS std::ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define RT(s) return cout<<s,0
#define sz(s) (long long)(s.size())
const long long N = 10 + 9, M = 150 + 9, MOD = 1e9 + 7, OO = 0x3f3f3f3f, MAX = 2147483647, LOO = 0x3f3f3f3f3f3f3f3f;
vector<int> a = { 1, 2, 1, 3, 2 };
int32_t main()
{
//IOS;
int n;
cin >> n;
vector<int> ans(n);
ans[0] = 0;
int cnt = 1;
for (int i = 1; i < n; i++)
{
bool can = 0;
for (int j = 0; j < i; j++)
{
int x = 0;
cout << "2 " << i + 1 << " " << j + 1 << "\n";
fflush(stdout);
cin >> x;
if (x == 1)
{
can = 1;
ans[i] = j;
break;
}
}
if (!can)
ans[i] = cnt++;
}
cout << "0 ";
for (int i = 0; i < n; i++)
cout << ans[i] + 1 << " ";
cout << "\n";
fflush(stdout);
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... |