#include <bits/stdc++.h>
#define mp make_pair
#define eb emplace_back
#define fi first
#define se second
using namespace std;
using cd = complex <double>;
typedef pair <int, int> pii;
const long long Inf = 2e18;
const long long mod = 1e9 + 7;
const double Pi = acos(-1);
void Fastio()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
}
int n, cnt;
int a[155], cntt[155];
int main()
{
// Fastio();
cin >> n;
a[1] = 1;
cntt[1] = 1;
cnt = 1;
for(int i = 2; i <= n; i++)
{
int l = 1, r = i - 1;
cout << i << ' ';
for(int j = 1; j <= i; j++)
{
cout << j << ' ';
}
cout << endl;
int x;
cin >> x;
if(x == cnt + 1)
{
a[i] = cnt + 1;
cntt[i] = cntt[i - 1] + 1;
cnt++;
}
else
{
cntt[i] = cntt[i - 1];
while(l < r)
{
int mid = (r + l) >> 1;
cout << mid + 1 << ' ';
for(int i = 1; i <= mid; i++)
{
cout << i << ' ';
}
cout << i << endl;
int x;
cin >> x;
if(x == cntt[mid])
{
r = mid;
}
else
{
l = mid + 1;
}
}
a[i] = a[l];
}
}
cout << 0 << ' ';
for(int i = 1; i <= n; i++)
{
cout << a[i] << ' ';
}
cout << endl;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
17 ms |
256 KB |
Output is correct |
2 |
Correct |
13 ms |
256 KB |
Output is correct |
3 |
Correct |
11 ms |
256 KB |
Output is correct |
4 |
Correct |
7 ms |
256 KB |
Output is correct |
5 |
Correct |
15 ms |
384 KB |
Output is correct |
6 |
Correct |
19 ms |
256 KB |
Output is correct |
7 |
Correct |
16 ms |
384 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
16 ms |
256 KB |
Output is correct |
2 |
Correct |
18 ms |
292 KB |
Output is correct |
3 |
Correct |
10 ms |
256 KB |
Output is correct |
4 |
Correct |
8 ms |
256 KB |
Output is correct |
5 |
Correct |
15 ms |
256 KB |
Output is correct |
6 |
Correct |
15 ms |
384 KB |
Output is correct |
7 |
Correct |
15 ms |
384 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
18 ms |
384 KB |
Output is correct |
2 |
Correct |
19 ms |
384 KB |
Output is correct |
3 |
Correct |
16 ms |
384 KB |
Output is correct |
4 |
Correct |
7 ms |
256 KB |
Output is correct |
5 |
Correct |
15 ms |
256 KB |
Output is correct |
6 |
Correct |
18 ms |
256 KB |
Output is correct |
7 |
Correct |
17 ms |
384 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
15 ms |
256 KB |
Output is correct |
2 |
Correct |
19 ms |
256 KB |
Output is correct |
3 |
Correct |
10 ms |
256 KB |
Output is correct |
4 |
Correct |
7 ms |
256 KB |
Output is correct |
5 |
Correct |
12 ms |
384 KB |
Output is correct |
6 |
Correct |
13 ms |
256 KB |
Output is correct |
7 |
Correct |
17 ms |
384 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
15 ms |
384 KB |
Output is correct |
2 |
Correct |
21 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 |
11 ms |
256 KB |
Output is correct |
6 |
Correct |
10 ms |
384 KB |
Output is correct |
7 |
Correct |
8 ms |
256 KB |
Output is correct |