/*
_____ _ _
/ ____| | | | |
| | __ _ __ __ _ ___ ___ _ _ _ __ ___ | |_ __ _| |_ ___
| | |_ | '__/ _` / __/ __| | | | '_ \ / _ \| __/ _` | __/ _ \
| |__| | | | (_| \__ \__ \ |_| | |_) | (_) | || (_| | || (_) |
\_____|_| \__,_|___/___/\__, | .__/ \___/ \__\__,_|\__\___/
__/ | |
|___/|_|
*/
#pragma gcc target ("avx2")
#pragma gcc optimization ("O3")
#pragma gcc optimization ("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
template<class T> using segset = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;
#define FOR(i, x, n) for (int i = x; i <= n; i++)
#define F0R(i, x, n) for (int i = x; i >= n; i--)
#define TRAV(it, x) for (auto it = x.begin(); it != x.end(); it++)
#define rall(x) x.rbegin(), x.rend()
#define all(x) x.begin(), x.end()
//#define f first
//#define s second
#define sz size
#define pob pop_back
#define pf push_front
#define pb push_back
#define ins insert
#define mp make_pair
#define rz resize
#define asg assign
#define rev reverse
#define lb lower_bound
#define ub upper_bound
// fill for 1
// 0x3f3f3f3f for 1e9
#define mem(a, x) memset(a, x, sizeof(a))
#define HEX 0x3f3f3f3f
using ll = long long;
const int INF = 2e5 + 5;
const int MOD = 1e9 + 7;
// DLRU
const int dx[4] = {1, 0, 0, -1};
const int dy[4] = {0, -1, 1, 0};
int n, ans[151];
int query(vector<int> v) {
cout << v.sz();
for (auto x : v) cout << ' ' << x;
cout << endl;
int cnt;
cin >> cnt;
return cnt;
}
vector<int> make(int l, int r, int add) {
vector<int> v;
FOR(i, l, r) {
v.pb(i);
}
if (add != -1) {
v.pb(add);
}
return v;
}
int main()
{
std::ios_base::sync_with_stdio(false); cin.tie(0);
cin >> n;
int id = 1;
ans[1] = 1;
FOR(i, 2, n) {
if (query(make(1, i, -1)) == id) {
int same = -1;
int l = 1, r = i - 1;
while (l <= r) {
int m = (l + r) / 2;
if (query(make(l, m, -1)) == query(make(l, m, i))) {
same = m;
r = m - 1;
} else {
l = m + 1;
}
}
ans[i] = ans[same];
} else {
id++;
ans[i] = id;
}
}
cout << 0;
FOR(i, 1, n) cout << ' ' << ans[i];
cout << endl;
return 0;
}
/*
*
*/
//
Compilation message
carnival.cpp:12: warning: ignoring '#pragma gcc target' [-Wunknown-pragmas]
12 | #pragma gcc target ("avx2")
|
carnival.cpp:13: warning: ignoring '#pragma gcc optimization' [-Wunknown-pragmas]
13 | #pragma gcc optimization ("O3")
|
carnival.cpp:14: warning: ignoring '#pragma gcc optimization' [-Wunknown-pragmas]
14 | #pragma gcc optimization ("unroll-loops")
|
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
16 ms |
208 KB |
Output is correct |
2 |
Correct |
13 ms |
208 KB |
Output is correct |
3 |
Correct |
7 ms |
208 KB |
Output is correct |
4 |
Correct |
4 ms |
312 KB |
Output is correct |
5 |
Correct |
17 ms |
296 KB |
Output is correct |
6 |
Correct |
19 ms |
208 KB |
Output is correct |
7 |
Correct |
9 ms |
316 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
17 ms |
208 KB |
Output is correct |
2 |
Correct |
20 ms |
208 KB |
Output is correct |
3 |
Correct |
5 ms |
208 KB |
Output is correct |
4 |
Correct |
6 ms |
312 KB |
Output is correct |
5 |
Correct |
16 ms |
312 KB |
Output is correct |
6 |
Correct |
17 ms |
208 KB |
Output is correct |
7 |
Correct |
19 ms |
296 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
12 ms |
208 KB |
Output is correct |
2 |
Correct |
19 ms |
296 KB |
Output is correct |
3 |
Correct |
13 ms |
208 KB |
Output is correct |
4 |
Correct |
3 ms |
208 KB |
Output is correct |
5 |
Correct |
14 ms |
208 KB |
Output is correct |
6 |
Correct |
14 ms |
208 KB |
Output is correct |
7 |
Correct |
12 ms |
308 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
19 ms |
296 KB |
Output is correct |
2 |
Correct |
21 ms |
312 KB |
Output is correct |
3 |
Correct |
9 ms |
316 KB |
Output is correct |
4 |
Correct |
4 ms |
208 KB |
Output is correct |
5 |
Correct |
16 ms |
208 KB |
Output is correct |
6 |
Correct |
11 ms |
296 KB |
Output is correct |
7 |
Correct |
16 ms |
208 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
18 ms |
208 KB |
Output is correct |
2 |
Correct |
18 ms |
300 KB |
Output is correct |
3 |
Correct |
12 ms |
208 KB |
Output is correct |
4 |
Correct |
10 ms |
316 KB |
Output is correct |
5 |
Correct |
8 ms |
312 KB |
Output is correct |
6 |
Correct |
12 ms |
308 KB |
Output is correct |
7 |
Correct |
4 ms |
320 KB |
Output is correct |