#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
typedef long long int ll;
const int N=200;
int P[N],ans[N];
int cnt=0;
int query(int P, int extra = -1) {
if (extra <= P) {
cout << P << " ";
for (int i = 1; i <= P; i++) cout << i << " ";
cout << endl;
fflush(stdout);
}
else {
cout << P + 1 << " ";
for (int i = 1; i <= P; i++) cout << i << " ";
cout << extra << endl;
fflush(stdout);
}
int rtn;
cin >> rtn;
return rtn;
}
int main()
{
int n; cin>>n;
for(int i=1; i<=n; i++) {
P[i]=query(i,0);
}
int nxt = 1;
for (int i = 1; i <= n; i++) {
int lo = 1, hi = i, mid;
while (lo < hi) {
mid = (lo + hi) / 2;
if (P[mid] == query(mid, i)) hi = mid;
else lo = mid + 1;
}
if (i == lo) ans[i] = nxt++;
else ans[i] = ans[lo];
}
cout<<0<<" ";
for(int i=1; i<=n; i++) {
cout<<ans[i]<<" ";
}
cout<<endl;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
13 ms |
384 KB |
Output is correct |
2 |
Correct |
14 ms |
384 KB |
Output is correct |
3 |
Correct |
14 ms |
384 KB |
Output is correct |
4 |
Correct |
15 ms |
256 KB |
Output is correct |
5 |
Correct |
9 ms |
304 KB |
Output is correct |
6 |
Correct |
11 ms |
256 KB |
Output is correct |
7 |
Correct |
15 ms |
256 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
13 ms |
384 KB |
Output is correct |
2 |
Correct |
7 ms |
256 KB |
Output is correct |
3 |
Correct |
11 ms |
384 KB |
Output is correct |
4 |
Correct |
12 ms |
384 KB |
Output is correct |
5 |
Correct |
8 ms |
384 KB |
Output is correct |
6 |
Correct |
7 ms |
304 KB |
Output is correct |
7 |
Correct |
10 ms |
256 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
11 ms |
256 KB |
Output is correct |
2 |
Correct |
10 ms |
256 KB |
Output is correct |
3 |
Correct |
12 ms |
256 KB |
Output is correct |
4 |
Correct |
13 ms |
256 KB |
Output is correct |
5 |
Correct |
8 ms |
256 KB |
Output is correct |
6 |
Correct |
13 ms |
256 KB |
Output is correct |
7 |
Correct |
15 ms |
256 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
8 ms |
256 KB |
Output is correct |
2 |
Correct |
9 ms |
256 KB |
Output is correct |
3 |
Correct |
15 ms |
384 KB |
Output is correct |
4 |
Correct |
17 ms |
384 KB |
Output is correct |
5 |
Correct |
7 ms |
256 KB |
Output is correct |
6 |
Correct |
14 ms |
384 KB |
Output is correct |
7 |
Correct |
12 ms |
256 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
11 ms |
256 KB |
Output is correct |
2 |
Correct |
7 ms |
384 KB |
Output is correct |
3 |
Correct |
17 ms |
384 KB |
Output is correct |
4 |
Correct |
15 ms |
256 KB |
Output is correct |
5 |
Correct |
8 ms |
256 KB |
Output is correct |
6 |
Correct |
17 ms |
384 KB |
Output is correct |
7 |
Correct |
15 ms |
384 KB |
Output is correct |