# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
960708 | 2024-04-11T00:59:08 Z | pcc | Carnival (CEOI14_carnival) | C++17 | 5 ms | 952 KB |
#include <bits/stdc++.h> using namespace std; #define ll long long #define pll pair<ll,ll> #define pii pair<int,int> #define fs first #define sc second #define tlll tuple<ll,ll,ll> const int mxn = 155; vector<int> v; int ans[mxn]; int ask(vector<int> vvv){ cout<<vvv.size()<<' '; for(auto &i:vvv)cout<<i<<' ';cout<<endl; int re; cin>>re; return re; } int main(){ ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); int n; cin>>n; v.push_back(1); ans[1] = 1; int pt = 2; for(int i = 2;i<=n;i++){ v.push_back(i); if(ask(v) == v.size()){ ans[i] = pt++; continue; } v.pop_back(); int l = 0,r = v.size()-1; while(l != r){ int mid = (l+r)>>1; vector<int> vv; for(int j = 0;j<=mid;j++){ vv.push_back(v[j]); } vv.push_back(i); if(ask(vv) == vv.size())l = mid+1; else r = mid; } ans[i] = ans[v[l]]; } cout<<0<<' ';for(int i = 1;i<=n;i++)cout<<ans[i]<<' ';cout<<endl; return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 344 KB | Output is correct |
2 | Correct | 4 ms | 344 KB | Output is correct |
3 | Correct | 3 ms | 456 KB | Output is correct |
4 | Correct | 2 ms | 952 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 | 344 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 344 KB | Output is correct |
2 | Correct | 5 ms | 344 KB | Output is correct |
3 | Correct | 2 ms | 600 KB | Output is correct |
4 | Correct | 2 ms | 704 KB | Output is correct |
5 | Correct | 3 ms | 344 KB | Output is correct |
6 | Correct | 3 ms | 340 KB | Output is correct |
7 | Correct | 4 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 | 5 ms | 452 KB | Output is correct |
4 | Correct | 2 ms | 452 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 | 456 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 344 KB | Output is correct |
2 | Correct | 2 ms | 344 KB | Output is correct |
3 | Correct | 3 ms | 456 KB | Output is correct |
4 | Correct | 2 ms | 712 KB | Output is correct |
5 | Correct | 3 ms | 344 KB | Output is correct |
6 | Correct | 4 ms | 452 KB | Output is correct |
7 | Correct | 5 ms | 344 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 344 KB | Output is correct |
2 | Correct | 3 ms | 344 KB | Output is correct |
3 | Correct | 4 ms | 448 KB | Output is correct |
4 | Correct | 3 ms | 456 KB | Output is correct |
5 | Correct | 4 ms | 452 KB | Output is correct |
6 | Correct | 2 ms | 452 KB | Output is correct |
7 | Correct | 3 ms | 704 KB | Output is correct |