#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 + 1) << " ";
cout << "\n";
fflush(stdout);
cin >> x;
if (x != y + 1)
{
for (int k = 0; k < sz(b); k++)
{
cout << "2 " << b[k] + 1 << " " << i + 1 << "\n";
fflush(stdout);
int z = 0;
cin >> z;
if (z < 2)
{
a[i] = a[b[k]];
break;
}
}
}
else
{
a[i] = ++cur;
b.push_back(i);
}
y = x;
}
cout << "0 ";
for (int i = 0; i < n; i++)
cout << a[i] << " ";
cout << "\n";
fflush(stdout);
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
9 ms |
208 KB |
Output is correct |
2 |
Correct |
19 ms |
292 KB |
Output is correct |
3 |
Correct |
12 ms |
296 KB |
Output is correct |
4 |
Correct |
4 ms |
208 KB |
Output is correct |
5 |
Correct |
4 ms |
208 KB |
Output is correct |
6 |
Correct |
3 ms |
208 KB |
Output is correct |
7 |
Correct |
11 ms |
208 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
7 ms |
208 KB |
Output is correct |
2 |
Correct |
16 ms |
208 KB |
Output is correct |
3 |
Correct |
12 ms |
208 KB |
Output is correct |
4 |
Correct |
8 ms |
208 KB |
Output is correct |
5 |
Correct |
3 ms |
208 KB |
Output is correct |
6 |
Correct |
3 ms |
208 KB |
Output is correct |
7 |
Correct |
7 ms |
208 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
208 KB |
Output is correct |
2 |
Correct |
5 ms |
208 KB |
Output is correct |
3 |
Correct |
19 ms |
208 KB |
Output is correct |
4 |
Correct |
4 ms |
208 KB |
Output is correct |
5 |
Correct |
3 ms |
208 KB |
Output is correct |
6 |
Correct |
3 ms |
296 KB |
Output is correct |
7 |
Correct |
15 ms |
288 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
208 KB |
Output is correct |
2 |
Correct |
7 ms |
208 KB |
Output is correct |
3 |
Correct |
6 ms |
304 KB |
Output is correct |
4 |
Correct |
5 ms |
208 KB |
Output is correct |
5 |
Correct |
4 ms |
296 KB |
Output is correct |
6 |
Correct |
5 ms |
208 KB |
Output is correct |
7 |
Correct |
15 ms |
304 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
208 KB |
Output is correct |
2 |
Correct |
11 ms |
208 KB |
Output is correct |
3 |
Correct |
16 ms |
208 KB |
Output is correct |
4 |
Correct |
16 ms |
208 KB |
Output is correct |
5 |
Correct |
5 ms |
208 KB |
Output is correct |
6 |
Correct |
3 ms |
208 KB |
Output is correct |
7 |
Correct |
6 ms |
208 KB |
Output is correct |