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 = 3e5 + 9, M = 1e9 + 9, MOD = 1e9 + 7, OO = 0x3f3f3f3f, MAX = 2147483647, LOO = 0x3f3f3f3f3f3f3f3f;
int32_t main()
{
//IOS;
int n, x, y = 0, cur = 0;
cin >> n;
vector<int> a(n), b;
for (int i = 0; i < n; i++)
{
cout << (i + 1) << " ";
for (int j = 0; j <= i; j++)
cout << j << " ";
cout << endl;
cin >> x;
if (x != y + 1)
{
for (int k = 0; k < sz(b); k++)
{
cout << "2 " << b[k] + 1 << " " << i + 1;
cout << endl;
int z = 0;
cin >> z;
if (z < 2)
{
a[i] = a[b[k]];
break;
}
}
}
else
{
a[i] = ++cur;
b.push_back(i);
}
y = x;
}
for (int i = 0; i < n; i++)
cout << a[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... |