답안 #750044

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
750044 2023-05-29T05:24:59 Z vjudge1 사육제 (CEOI14_carnival) C++14
100 / 100
13 ms 836 KB
//#pragma GCC optimize("Ofast,unroll-loops")
//#pragma GCC target("bmi,bmi2,lzcnt,popcnt")
//#pragma GCC target("avx2,popcnt,lzcnt,abm,bmi,bmi2,fma,tune=native")
//#pragma expected_value
//#pragma isolated_call
//#pragma disjoint

#include<bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>

//using namespace __gnu_pbds;
using namespace std;

//#define int long long
//#define double long double
#define Fi first
#define Se second
#define Rep(i,a,b) for (int i=a;i<=b;++i)
#define Repu(i,b,a) for (int i=b;i>=a;--i)
#define pb push_back
#define ms(a,i) memset(a,i,sizeof(a))
#define sz size()
#define mp make_pair
#define endl '\n'
#define sef setprecision(12)<<fixed
#define cer cout<<"cak"<<endl;

typedef pair<int,int> ii;
typedef vector<int> vi;
typedef vector<double> va;
typedef vector<ii> vii;
typedef vector<vi> vvi;
typedef vector<va> vva;

//const double EPS=1e-9;
const double PI=acos(-1);
//const int oo=1e18;
const int MN=155;
const int mod=1e9+7;

using cd=complex<double>;

//typedef tree<int,null_type,less<int>,rb_tree_tag, tree_order_statistics_node_update> index_set;

int n;
int a[MN];

int pre[MN];

set<int> s[MN];

int cnt=1;

int x;

signed main() {
    //ios_base::sync_with_stdio(false);
    //cin.tie(NULL);
    //cout.tie(NULL);

    cin>>n;

    Rep(i,1,n) {
        cout<<i<<" ";
        Rep(j,1,i) cout<<j<<" ";
        cout<<endl;
        cin>>pre[i];

        if(pre[i]==pre[i-1]+1) {
            a[i]=cnt++;
            s[i]=s[i-1];
            s[i].insert(a[i]);
        }

        else {
            s[i]=s[i-1];
            int l=1,r=i-1;
            while(l<=r) {
                int mid=(l+r)/2;
                cout<<mid+1<<" ";
                Rep(k,1,mid) cout<<k<<" ";
                cout<<i<<endl;
                cin>>x;

                if(x==pre[mid]+1) l=mid+1;
                else r=mid-1;
            }
            a[i]=a[l];
        }

    }

    cout<<0<<" ";
    Rep(i,1,n) cout<<a[i]<<" ";
}
# 결과 실행 시간 메모리 Grader output
1 Correct 11 ms 348 KB Output is correct
2 Correct 11 ms 372 KB Output is correct
3 Correct 5 ms 632 KB Output is correct
4 Correct 4 ms 720 KB Output is correct
5 Correct 10 ms 312 KB Output is correct
6 Correct 9 ms 208 KB Output is correct
7 Correct 9 ms 408 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 12 ms 328 KB Output is correct
2 Correct 13 ms 400 KB Output is correct
3 Correct 6 ms 464 KB Output is correct
4 Correct 4 ms 636 KB Output is correct
5 Correct 8 ms 332 KB Output is correct
6 Correct 9 ms 308 KB Output is correct
7 Correct 10 ms 336 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 9 ms 208 KB Output is correct
2 Correct 10 ms 320 KB Output is correct
3 Correct 9 ms 548 KB Output is correct
4 Correct 4 ms 836 KB Output is correct
5 Correct 10 ms 344 KB Output is correct
6 Correct 8 ms 316 KB Output is correct
7 Correct 11 ms 464 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 12 ms 320 KB Output is correct
2 Correct 9 ms 328 KB Output is correct
3 Correct 6 ms 720 KB Output is correct
4 Correct 3 ms 764 KB Output is correct
5 Correct 8 ms 440 KB Output is correct
6 Correct 7 ms 556 KB Output is correct
7 Correct 9 ms 408 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 12 ms 308 KB Output is correct
2 Correct 10 ms 336 KB Output is correct
3 Correct 9 ms 604 KB Output is correct
4 Correct 8 ms 660 KB Output is correct
5 Correct 8 ms 484 KB Output is correct
6 Correct 6 ms 644 KB Output is correct
7 Correct 4 ms 820 KB Output is correct