# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
596456 | 2022-07-14T18:58:14 Z | Summers | 사육제 (CEOI14_carnival) | C++14 | 9 ms | 248 KB |
#include<bits/stdc++.h> #define endl '\n' using namespace std; long long a[10000], r[1000]; int main() { long long i,j,n,le,ri,mid,num=1,ans; cin>>n; a[1]=1;r[1]=1; for(i=2;i<=n;i++) { cout<<num+1; for(j=1;j<=num;j++)cout<<" "<<a[j]; cout<<" "<<i<<endl; cin>>ans; if(ans>num){num++;a[num]=i;r[i]=num;continue;} le=1; ri=num; while(le<=ri) { mid=(le+ri)/2; cout<<mid-le+2; for(j=le;j<=mid;j++)cout<<" "<<a[j]; cout<<" "<<i; cout<<endl; cin>>ans; if(ans==(mid-le+1))ri=mid-1; else le=mid+1; } r[i]=le; } cout<<0; for(i=1;i<=n;i++)cout<<" "<<r[i];cout<<endl; return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 6 ms | 208 KB | Output is correct |
2 | Correct | 9 ms | 248 KB | Output is correct |
3 | Correct | 3 ms | 208 KB | Output is correct |
4 | Correct | 4 ms | 208 KB | Output is correct |
5 | Correct | 4 ms | 208 KB | Output is correct |
6 | Correct | 3 ms | 208 KB | Output is correct |
7 | Correct | 7 ms | 208 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 208 KB | Output is correct |
2 | Correct | 6 ms | 208 KB | Output is correct |
3 | Correct | 3 ms | 208 KB | Output is correct |
4 | Correct | 2 ms | 208 KB | Output is correct |
5 | Correct | 3 ms | 208 KB | Output is correct |
6 | Correct | 6 ms | 208 KB | Output is correct |
7 | Correct | 7 ms | 208 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 208 KB | Output is correct |
2 | Correct | 3 ms | 208 KB | Output is correct |
3 | Correct | 4 ms | 208 KB | Output is correct |
4 | Correct | 4 ms | 208 KB | Output is correct |
5 | Correct | 3 ms | 208 KB | Output is correct |
6 | Correct | 6 ms | 208 KB | Output is correct |
7 | Correct | 8 ms | 208 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 208 KB | Output is correct |
2 | Correct | 8 ms | 208 KB | Output is correct |
3 | Correct | 5 ms | 208 KB | Output is correct |
4 | Correct | 3 ms | 208 KB | Output is correct |
5 | Correct | 6 ms | 208 KB | Output is correct |
6 | Correct | 6 ms | 208 KB | Output is correct |
7 | Correct | 8 ms | 208 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 6 ms | 208 KB | Output is correct |
2 | Correct | 4 ms | 208 KB | Output is correct |
3 | Correct | 6 ms | 208 KB | Output is correct |
4 | Correct | 7 ms | 208 KB | Output is correct |
5 | Correct | 6 ms | 208 KB | Output is correct |
6 | Correct | 3 ms | 208 KB | Output is correct |
7 | Correct | 3 ms | 208 KB | Output is correct |