# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
396453 | 2021-04-30T01:20:01 Z | Pichon5 | 사육제 (CEOI14_carnival) | C++17 | 22 ms | 300 KB |
#include <iostream> #include <bits/stdc++.h> #define vi vector<int> #define pb push_back using namespace std; int main() { int n; cin>>n; vi color(n+1,0); color[1]=1; vi v; v.pb(1); for(int i=2;i<=n;i++){ cout<<v.size()+1<<" "<<i<<" "; for(int l=0;l<v.size();l++){ cout<<v[l]<<" "; } cout<<endl; int F; cin>>F; if(F>v.size()){ color[i]=F; v.pb(i); }else{ int b=0,e=v.size()-1; int aux=10; while(b<=e && aux--){ int mid=(b+e)/2; if(b==e){color[i]=color[v[b]];break;} cout<<mid-b+2<<" "; int N=mid-b+1; cout<<i<<" "; for(int l=b;l<=mid;l++){ cout<<v[l]<<" "; } cout<<endl; int F; cin>>F; if(F==N){ e=mid; color[i]=color[v[mid]]; }else{ b=mid; color[i]=color[v[e]]; } } } } cout<<0<<" "; for(int i=1;i<=n;i++){ cout<<color[i]<<" "; } cout<<endl; return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 22 ms | 204 KB | Output is correct |
2 | Correct | 11 ms | 200 KB | Output is correct |
3 | Correct | 6 ms | 200 KB | Output is correct |
4 | Correct | 5 ms | 300 KB | Output is correct |
5 | Correct | 12 ms | 200 KB | Output is correct |
6 | Correct | 4 ms | 200 KB | Output is correct |
7 | Correct | 14 ms | 200 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 6 ms | 200 KB | Output is correct |
2 | Correct | 12 ms | 204 KB | Output is correct |
3 | Correct | 7 ms | 200 KB | Output is correct |
4 | Correct | 5 ms | 200 KB | Output is correct |
5 | Correct | 11 ms | 200 KB | Output is correct |
6 | Correct | 4 ms | 200 KB | Output is correct |
7 | Correct | 13 ms | 200 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 200 KB | Output is correct |
2 | Correct | 17 ms | 204 KB | Output is correct |
3 | Correct | 14 ms | 200 KB | Output is correct |
4 | Correct | 4 ms | 200 KB | Output is correct |
5 | Correct | 12 ms | 200 KB | Output is correct |
6 | Correct | 10 ms | 200 KB | Output is correct |
7 | Correct | 12 ms | 200 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 14 ms | 200 KB | Output is correct |
2 | Correct | 19 ms | 200 KB | Output is correct |
3 | Correct | 6 ms | 200 KB | Output is correct |
4 | Correct | 4 ms | 200 KB | Output is correct |
5 | Correct | 10 ms | 200 KB | Output is correct |
6 | Correct | 12 ms | 200 KB | Output is correct |
7 | Correct | 16 ms | 200 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 9 ms | 200 KB | Output is correct |
2 | Correct | 13 ms | 220 KB | Output is correct |
3 | Correct | 8 ms | 200 KB | Output is correct |
4 | Correct | 10 ms | 200 KB | Output is correct |
5 | Correct | 12 ms | 200 KB | Output is correct |
6 | Correct | 6 ms | 200 KB | Output is correct |
7 | Correct | 4 ms | 200 KB | Output is correct |