# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
203561 | triplem5ds | Carnival (CEOI14_carnival) | C++14 | 97 ms | 504 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.
#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
#include "bits/stdc++.h"
using namespace std;
#define f(i,a,b) for(int i = a; i < b; i++)
#define pb push_back
#define F first
#define S second
const int N = 1e6+5;
const int MOD = 1e9 + 7;
int ask(vector<int> v){
cout<<v.size();
for(auto x:v)cout<<' '<<x;
cout<<endl;
int ret; cin >> ret; return ret;
}
int32_t main(){
#ifdef ONLINE_JUDGE
ios_base::sync_with_stdio(0); cin.tie(0);
#endif // ONLINE_JUDGE
int n;
cin >> n;
vector<bool>vis(n+1);
map<int,int> mp;
int cur = 0;
while(mp.size()!=n){
vector<int> v;
f(i,1,n+1)
if(!vis[i]){
if(v.empty())v.pb(i);
else {
v.pb(i);
int x = ask(v);
if(x!=1)v.pop_back();
}
}
cur++;
for(auto k:v){
vis[k]=1;
mp[k]=cur;
}
}
cout<<0;
f(i,1,n+1) cout << ' ' << mp[i]; cout << endl;
return 0;
}
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... |