#include <bits/stdc++.h>
#define int long long
using namespace std;
const int maxn = 1000;
int n, m, mark[1000], type[maxn], cnt = -1;
int Ask(int l, int r)
{
cout << r - l + 1 << ' ';
for(int i = l; i <= r; i++) cout << i << ' ';
cout << endl;
int x;
cin >> x;
return x;
}
int Ask1(int x, int y)
{
cout << 2 << ' ';
cout << x << ' ' << y << endl;
int z;
cin >> z;
return z;
}
void Ans()
{
cout << 0 << ' ';
for(int i = 1; i <= n; i++) cout << type[i] << ' ';
cout << endl;
}
int32_t main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
//freopen("test.inp", "r", stdin);freopen("test.out", "w", stdout);
fill_n(type, maxn, -1);
int old = 0;
for(int i = 1; i <= n; i++)
{
mark[i] = mark[i - 1];
int New = Ask(1, i);
if(New == old + 1)
{
mark[i]++;
}
old = New;
}
for(int i = 1; i <= n; i++)
{
if(mark[i])
{
type[i] = ++cnt;
int t = i + 1;
for(; t <= n && !mark[t]; t++)
{
if(type[t] == -1) type[t] = cnt;
}
for(int j = t; j <= n; j++)
{
if(!mark[j] && type[j] == -1 && Ask1(i, j) == 1)
{
type[i] = cnt;
}
}
}
}
Ans();
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
256 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
256 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
256 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
384 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
384 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |