This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#include<unordered_map>
#define pll pair<ll, ll>
#define ll long long
#define int long long
#define pb push_back
#define ff first
#define ss second
#define ins insert
#define pll2 pair<pair<ll,ll>,ll>
#define bit(i,k) (k>>i)&1
using namespace std;
const long long mod = 1e9 + 7;
const ll maxN = 3e6;
const ll inf = 1e18;
ll pre[maxN];
ll type[maxN];
void solve() {
ll n;
cin >> n;
for (int i = 1; i <= n; i++) {
cout << i;
for (int j = 1; j <= i; j++) {
cout << " " << j;
}
cout << endl;
cin >> pre[i];
}
ll cur = 0;
for (int i = 1; i <= n; i++) {
ll l = 0, r = i-1;
ll mx = 0;
while (l <= r) {
ll md = (l + r) / 2;
cout << md +1 << " ";
for (int j = 1; j <= md; j++) {
cout << j << " ";
}
cout << i;
cout << endl;
ll x;
cin >> x;
if (pre[md] + 1 == x) {
l = md + 1;
mx = max(mx, md);
}
else {
r = md - 1;
}
}
if (mx+1 == i) {
cur++;
type[i] = cur;
}
else {
type[i] = type[mx+1];
}
}
cout << 0 << " ";
for (int i = 1; i <= n; i++) {
cout << type[i] << " ";
}
cout << endl;
}
signed main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
// freopen("09.inp", "r", stdin);
// freopen("09.out", "w", stdout);
ll nhim = 1;
//cin >> nhim;
while (nhim--) {
solve();
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |