# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
995908 | fimh | Carnival (CEOI14_carnival) | C++14 | 5 ms | 600 KiB |
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>
using namespace std;
using ll = long long;
using pll = pair<ll, ll>;
#define fi first
#define int long long
#define se second
const ll N = 150 + 5;
const ll blocksz = 320;
const ll mod = 1e9 + 7;
const ll inf = 1e18;
ll n, rep;
ll id[N];
void task(){
cin >> n;
vector<ll> v;
for (int i = 1; i <= n; ++i){
cout << i << " ";
for (int j = 1; j <= i; ++j) cout << j << " ";
cout << endl;
cin >> rep;
// cout << v.size() << " ";
if (rep == v.size()){
// cout << "ddd";
int l = -1, r = v.size() - 1;
while (l < r){
ll m = l + (r - l + 1) / 2;
// cout << m << " ";
cout << v.size() - m + 1<< " " << i << " ";
for (int j = m; j < v.size(); ++j) cout << v[j] << " ";
cout << endl;
cin >> rep;
if (rep < v.size() - m + 1) l = m;
else r = m - 1;
}
id[i] = id[v[l]];
}else{
v.push_back(i);
id[i] = v.size();
}
}
cout << 0 << " ";
for (int i = 1; i <= n; ++i){
cout << id[i] << " ";
}
}
signed main(){
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
ll TC = 1; // cin >> TC;
while (TC--) task();
}
Compilation message (stderr)
# | 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... |