답안 #995995

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
995995 2024-06-10T06:50:14 Z vjudge1 사육제 (CEOI14_carnival) C++17
100 / 100
7 ms 344 KB
#include<bits/stdc++.h>
#define int long long
using namespace std;
int n;
int call(){
    int x;
    cin>>x;
    return x;
}
int32_t main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int tmp=0;
    cin>>n;
    vector<int> v(n+1,0),res(n+1,0);
    for(int i=1;i<=n;i++){
        cout<<i;
        for(int j=1;j<=i;j++) cout<<" "<<j;
        cout<<endl;
        int x=call();
        if(x>tmp){
            tmp++;
            v[tmp]=i;
            res[i]=tmp;
        }
    }
    for(int i=1;i<=n;i++){
        if(res[i]==0){
            int l=1,r=tmp,idx=-1;
            while(l<=r){
                int m=(l+r)/2;
                cout<<m+1<<" "<<i;
                for(int j=1;j<=m;j++) cout<<" "<<v[j];
                cout<<endl;
                int x=call();
                if(x>m) l=m+1;
                else{
                    idx=m;
                    r=m-1;
                }
            }
            res[i]=idx;
        }
    }
    for(int i=0;i<=n;i++) cout<<res[i]<<" ";
}
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 344 KB Output is correct
2 Correct 4 ms 344 KB Output is correct
3 Correct 3 ms 344 KB Output is correct
4 Correct 2 ms 344 KB Output is correct
5 Correct 3 ms 344 KB Output is correct
6 Correct 2 ms 344 KB Output is correct
7 Correct 4 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 344 KB Output is correct
2 Correct 7 ms 344 KB Output is correct
3 Correct 2 ms 344 KB Output is correct
4 Correct 3 ms 344 KB Output is correct
5 Correct 3 ms 344 KB Output is correct
6 Correct 5 ms 344 KB Output is correct
7 Correct 4 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 344 KB Output is correct
2 Correct 3 ms 344 KB Output is correct
3 Correct 4 ms 344 KB Output is correct
4 Correct 2 ms 344 KB Output is correct
5 Correct 5 ms 344 KB Output is correct
6 Correct 4 ms 344 KB Output is correct
7 Correct 5 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 344 KB Output is correct
2 Correct 3 ms 344 KB Output is correct
3 Correct 3 ms 344 KB Output is correct
4 Correct 2 ms 344 KB Output is correct
5 Correct 4 ms 344 KB Output is correct
6 Correct 4 ms 344 KB Output is correct
7 Correct 4 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 344 KB Output is correct
2 Correct 4 ms 344 KB Output is correct
3 Correct 5 ms 344 KB Output is correct
4 Correct 3 ms 344 KB Output is correct
5 Correct 3 ms 344 KB Output is correct
6 Correct 3 ms 344 KB Output is correct
7 Correct 2 ms 344 KB Output is correct