답안 #918716

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
918716 2024-01-30T09:55:34 Z vjudge1 사육제 (CEOI14_carnival) C++17
100 / 100
10 ms 596 KB
#include<bits/stdc++.h>
#define ll long long;
using namespace std;

int main()
{
    int n,mx=0,l,r,a,b,i,j,vl,mid;
    cin>>n;
    vector<int>v;
    vector<int>ans(n+1);
    for(i=1;i<=n;i++)
    {
        cout<<i<<' ';
        for(j=1;j<=i;j++)
        cout<<j<<' ';
        cout<<endl;
        cin>>vl;
        if(vl>mx)
        {
            mx=vl;
            ans[i]=mx;
        }
        else
        {
            l=1;
            r=i-1;
            while(l<=r)
            {
                mid=(l+r)/2;
                cout<<mid<<' ';
                for(j=1;j<=mid;j++)
                {
                    cout<<j<<' ';
                }
                cout<<endl;
                cin>>a;
                cout<<mid+1<<' ';
                for(j=1;j<=mid;j++)
                {
                    cout<<j<<' ';
                }
                cout<<i;
                cout<<endl;
                cin>>b;
                if(a==b)
                r=mid-1;
                else 
                l=mid+1;
            }
            ans[i]=ans[l];
        }
    }
    cout<<0<<" ";
    for(int i=1;i<=n;i++)
    {
        cout<<ans[i]<<" ";
    }
    cout<<endl;
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 9 ms 344 KB Output is correct
2 Correct 10 ms 504 KB Output is correct
3 Correct 4 ms 344 KB Output is correct
4 Correct 2 ms 344 KB Output is correct
5 Correct 8 ms 344 KB Output is correct
6 Correct 7 ms 344 KB Output is correct
7 Correct 7 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 9 ms 344 KB Output is correct
2 Correct 8 ms 344 KB Output is correct
3 Correct 3 ms 344 KB Output is correct
4 Correct 3 ms 344 KB Output is correct
5 Correct 7 ms 344 KB Output is correct
6 Correct 7 ms 344 KB Output is correct
7 Correct 8 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 344 KB Output is correct
2 Correct 8 ms 344 KB Output is correct
3 Correct 8 ms 344 KB Output is correct
4 Correct 2 ms 344 KB Output is correct
5 Correct 6 ms 344 KB Output is correct
6 Correct 6 ms 344 KB Output is correct
7 Correct 8 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 8 ms 344 KB Output is correct
2 Correct 9 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 6 ms 344 KB Output is correct
6 Correct 5 ms 344 KB Output is correct
7 Correct 7 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 10 ms 344 KB Output is correct
2 Correct 8 ms 344 KB Output is correct
3 Correct 7 ms 596 KB Output is correct
4 Correct 5 ms 344 KB Output is correct
5 Correct 5 ms 344 KB Output is correct
6 Correct 3 ms 344 KB Output is correct
7 Correct 2 ms 344 KB Output is correct