# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
317983 | 2020-10-31T04:16:23 Z | nandonathaniel | 사육제 (CEOI14_carnival) | C++14 | 37 ms | 384 KB |
#include<bits/stdc++.h> using namespace std; int ans[155],x; int tanya(int l,int r){ cout << r-l+1; for(int i=l;i<=r;i++){ cout << " " << i; } cout << endl; cin >> x; return x; } bool valid(int l,int r){ int y=tanya(l,r); set<int> S; for(int i=l;i<r;i++)S.insert(ans[i]); return S.size()==y; } int main(){ int n,x; cin >> n; ans[1]=1; int last=1,no=1; for(int i=2;i<=n;i++){ int x=tanya(1,i); if(x>last){ no++; ans[i]=no; last=x; continue; } int ki=1,ka=i-1,res; while(ki<=ka){ int mid=(ki+ka)/2; if(valid(mid,i)){ res=mid; ki=mid+1; } else ka=mid-1; } ans[i]=ans[res]; } cout << 0; for(int i=1;i<=n;i++)cout << " " << ans[i]; cout << endl; return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 12 ms | 256 KB | Output is correct |
2 | Correct | 11 ms | 256 KB | Output is correct |
3 | Correct | 6 ms | 256 KB | Output is correct |
4 | Correct | 3 ms | 256 KB | Output is correct |
5 | Correct | 14 ms | 256 KB | Output is correct |
6 | Correct | 12 ms | 256 KB | Output is correct |
7 | Correct | 37 ms | 256 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 12 ms | 256 KB | Output is correct |
2 | Correct | 14 ms | 256 KB | Output is correct |
3 | Correct | 5 ms | 256 KB | Output is correct |
4 | Correct | 5 ms | 256 KB | Output is correct |
5 | Correct | 11 ms | 256 KB | Output is correct |
6 | Correct | 11 ms | 256 KB | Output is correct |
7 | Correct | 8 ms | 256 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 10 ms | 256 KB | Output is correct |
2 | Correct | 13 ms | 256 KB | Output is correct |
3 | Correct | 10 ms | 380 KB | Output is correct |
4 | Correct | 4 ms | 256 KB | Output is correct |
5 | Correct | 10 ms | 256 KB | Output is correct |
6 | Correct | 11 ms | 256 KB | Output is correct |
7 | Correct | 9 ms | 384 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 11 ms | 256 KB | Output is correct |
2 | Correct | 14 ms | 256 KB | Output is correct |
3 | Correct | 6 ms | 256 KB | Output is correct |
4 | Correct | 4 ms | 256 KB | Output is correct |
5 | Correct | 9 ms | 256 KB | Output is correct |
6 | Correct | 8 ms | 256 KB | Output is correct |
7 | Correct | 15 ms | 256 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 16 ms | 256 KB | Output is correct |
2 | Correct | 17 ms | 288 KB | Output is correct |
3 | Correct | 9 ms | 384 KB | Output is correct |
4 | Correct | 8 ms | 256 KB | Output is correct |
5 | Correct | 8 ms | 384 KB | Output is correct |
6 | Correct | 5 ms | 256 KB | Output is correct |
7 | Correct | 4 ms | 256 KB | Output is correct |