# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
954052 | 2024-03-27T07:25:49 Z | irmuun | Carnival (CEOI14_carnival) | C++17 | 4 ms | 704 KB |
#include<bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define ff first #define ss second #define all(s) s.begin(),s.end() #define rall(s) s.rbegin(),s.rend() int main(){ ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); ll n; cin>>n; //find all different ll bef=0; vector<ll>v,col(n+5,0); ll cur=0; vector<bool>used(n+5,0); for(ll i=1;i<=n;i++){ cout<<v.size()+1<<' '; for(auto j:v){ cout<<j<<' '; } cout<<i<<endl; ll x; cin>>x; if(x==v.size()+1){ col[i]=++cur; v.pb(i); used[i]=true; } } for(ll i=1;i<=n;i++){ if(used[i]) continue; ll l=0,r=v.size()-1; while(l<r){ ll mid=(l+r)/2; cout<<mid+2<<' '; for(ll j=0;j<=mid;j++){ cout<<v[j]<<' '; } cout<<i<<endl; ll x; cin>>x; if(x==mid+2){ l=mid+1; } else{ r=mid; } } col[i]=l+1; } cout<<"0 "; for(ll i=1;i<=n;i++){ cout<<col[i]<<' '; } cout<<endl; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 344 KB | Output is correct |
2 | Correct | 3 ms | 456 KB | Output is correct |
3 | Correct | 3 ms | 456 KB | Output is correct |
4 | Correct | 1 ms | 448 KB | Output is correct |
5 | Correct | 2 ms | 344 KB | Output is correct |
6 | Correct | 1 ms | 344 KB | Output is correct |
7 | Correct | 4 ms | 700 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 344 KB | Output is correct |
2 | Correct | 3 ms | 344 KB | Output is correct |
3 | Correct | 2 ms | 456 KB | Output is correct |
4 | Correct | 2 ms | 456 KB | Output is correct |
5 | Correct | 3 ms | 344 KB | Output is correct |
6 | Correct | 3 ms | 344 KB | Output is correct |
7 | Correct | 3 ms | 344 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 344 KB | Output is correct |
2 | Correct | 2 ms | 344 KB | Output is correct |
3 | Correct | 4 ms | 704 KB | Output is correct |
4 | Correct | 2 ms | 452 KB | Output is correct |
5 | Correct | 4 ms | 344 KB | Output is correct |
6 | Correct | 3 ms | 456 KB | Output is correct |
7 | Correct | 4 ms | 452 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 344 KB | Output is correct |
2 | Correct | 3 ms | 344 KB | Output is correct |
3 | Correct | 3 ms | 600 KB | Output is correct |
4 | Correct | 2 ms | 452 KB | Output is correct |
5 | Correct | 4 ms | 500 KB | Output is correct |
6 | Correct | 3 ms | 452 KB | Output is correct |
7 | Correct | 3 ms | 452 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 344 KB | Output is correct |
2 | Correct | 3 ms | 388 KB | Output is correct |
3 | Correct | 3 ms | 456 KB | Output is correct |
4 | Correct | 3 ms | 448 KB | Output is correct |
5 | Correct | 3 ms | 452 KB | Output is correct |
6 | Correct | 2 ms | 456 KB | Output is correct |
7 | Correct | 2 ms | 604 KB | Output is correct |