# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
220144 | 2020-04-07T06:40:50 Z | MKopchev | 사육제 (CEOI14_carnival) | C++14 | 12 ms | 512 KB |
#include<bits/stdc++.h> using namespace std; const int nmax=1e3+42; int ask(vector<int> v) { cout<<v.size(); for(auto k:v)cout<<" "<<k; cout<<endl; int ret; cin>>ret; return ret; } int output[nmax]; vector<int> my_merge(vector<int> v,int val) { v.push_back(val); return v; } int main() { int n; cin>>n; vector<int> diff={}; for(int i=1;i<=n;i++) { if(ask(my_merge(diff,i))==diff.size()+1){diff.push_back(i);output[i]=diff.size();} else { //output[i] is within output[diff[j]] vector<int> active=diff; while(active.size()>1) { vector<int> help[2]; help[0]={}; help[1]={}; for(int j=0;j<active.size();j++) help[j%2].push_back(active[j]); if(ask(my_merge(help[0],i))==help[0].size())active=help[0]; else active=help[1]; } output[i]=output[active[0]]; } } cout<<0;for(int i=1;i<=n;i++)cout<<" "<<output[i];cout<<endl; return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 10 ms | 384 KB | Output is correct |
2 | Correct | 11 ms | 384 KB | Output is correct |
3 | Correct | 9 ms | 384 KB | Output is correct |
4 | Correct | 7 ms | 256 KB | Output is correct |
5 | Correct | 7 ms | 256 KB | Output is correct |
6 | Correct | 7 ms | 256 KB | Output is correct |
7 | Correct | 12 ms | 384 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 9 ms | 256 KB | Output is correct |
2 | Correct | 12 ms | 256 KB | Output is correct |
3 | Correct | 8 ms | 384 KB | Output is correct |
4 | Correct | 7 ms | 384 KB | Output is correct |
5 | Correct | 10 ms | 256 KB | Output is correct |
6 | Correct | 10 ms | 384 KB | Output is correct |
7 | Correct | 10 ms | 256 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 6 ms | 256 KB | Output is correct |
2 | Correct | 8 ms | 384 KB | Output is correct |
3 | Correct | 10 ms | 384 KB | Output is correct |
4 | Correct | 7 ms | 384 KB | Output is correct |
5 | Correct | 10 ms | 256 KB | Output is correct |
6 | Correct | 11 ms | 256 KB | Output is correct |
7 | Correct | 11 ms | 256 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 9 ms | 384 KB | Output is correct |
2 | Correct | 9 ms | 384 KB | Output is correct |
3 | Correct | 9 ms | 384 KB | Output is correct |
4 | Correct | 7 ms | 384 KB | Output is correct |
5 | Correct | 11 ms | 384 KB | Output is correct |
6 | Correct | 11 ms | 256 KB | Output is correct |
7 | Correct | 11 ms | 256 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 7 ms | 256 KB | Output is correct |
2 | Correct | 11 ms | 256 KB | Output is correct |
3 | Correct | 8 ms | 380 KB | Output is correct |
4 | Correct | 10 ms | 384 KB | Output is correct |
5 | Correct | 11 ms | 256 KB | Output is correct |
6 | Correct | 11 ms | 512 KB | Output is correct |
7 | Correct | 8 ms | 256 KB | Output is correct |