답안 #533482

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
533482 2022-03-06T07:17:28 Z kebine 사육제 (CEOI14_carnival) C++17
100 / 100
10 ms 328 KB
#include <bits/stdc++.h>
#define ll long long
#define fi first
#define se second
const ll MOD=1e9+7;
using namespace std;
ll N,a[155];
map <ll,ll> mp;
int main(){
  cin>>N;
  ll prev=0;
  for(int i=1;i<=N;i++){
    cout<<i<<' ';
    for(int j=1;j<=i;j++){
      cout<<j<<' ';
    }
    cout<<endl;
    ll x;
    cin>>x;
    if(x==prev+1){
      a[i]=x;
      mp[x]=i;
    }
    else{
      ll l=1;
      ll r=x;
      ll ans=0;
      while(l<=r){
        ll m=(l+r)/2;
        cout<<m-l+2<<' '<<i<<' ';
        for(int j=l;j<=m;j++){
          cout<<mp[j]<<' ';
        }
        cout<<endl;
        ll temp;
        cin>>temp;
        if(temp==m-l+1){
          ans=m;
          r=m-1;
        }
        else{
          l=m+1;
        }
      }
      a[i]=ans;
    }
    prev=x;
  }
  cout<<0<<' ';
  for(int i=1;i<=N;i++){
    cout<<a[i]<<' ';
  }
  cout<<endl;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 200 KB Output is correct
2 Correct 8 ms 200 KB Output is correct
3 Correct 5 ms 200 KB Output is correct
4 Correct 4 ms 292 KB Output is correct
5 Correct 5 ms 200 KB Output is correct
6 Correct 3 ms 200 KB Output is correct
7 Correct 8 ms 200 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 200 KB Output is correct
2 Correct 8 ms 200 KB Output is correct
3 Correct 4 ms 200 KB Output is correct
4 Correct 3 ms 300 KB Output is correct
5 Correct 7 ms 200 KB Output is correct
6 Correct 5 ms 200 KB Output is correct
7 Correct 6 ms 200 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 200 KB Output is correct
2 Correct 3 ms 328 KB Output is correct
3 Correct 7 ms 200 KB Output is correct
4 Correct 4 ms 200 KB Output is correct
5 Correct 5 ms 200 KB Output is correct
6 Correct 5 ms 200 KB Output is correct
7 Correct 8 ms 300 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 200 KB Output is correct
2 Correct 6 ms 200 KB Output is correct
3 Correct 5 ms 200 KB Output is correct
4 Correct 4 ms 296 KB Output is correct
5 Correct 10 ms 200 KB Output is correct
6 Correct 9 ms 204 KB Output is correct
7 Correct 7 ms 200 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 200 KB Output is correct
2 Correct 7 ms 200 KB Output is correct
3 Correct 6 ms 200 KB Output is correct
4 Correct 7 ms 200 KB Output is correct
5 Correct 7 ms 200 KB Output is correct
6 Correct 4 ms 300 KB Output is correct
7 Correct 3 ms 200 KB Output is correct