답안 #534653

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
534653 2022-03-08T13:01:04 Z YaserFaisal 사육제 (CEOI14_carnival) C++14
0 / 100
119 ms 1320 KB
#include <bits/stdc++.h> 
 
using namespace std ;
 
#define int long long
#define X first 
#define Y second
#define F first 
#define S second
//#define endl "\n"
#define pii pair < int , int >
 
int pre[155] , ans[155] , v[155] ;
void BS( int l , int r , int cur )
{
    if ( l == r )
    {
        ans[cur] = ans[l] ;
        return ;
    }
    int mid = (l+r)/2 ;
    cout << (mid-l+2) << " " << cur << " " ;
    for ( int i = l ; i <= mid ; i++ ) cout << v[i] << " " ;
    cout << endl ;
    int x ; cin >> x ;
    if ( x == (mid-l+2) ) BS( mid+1 , r , cur ) ;
    else BS( l , mid-1 , cur ) ;
}
 
int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int n ; cin >> n ; 
    int c = 0 ;
    for ( int i = 1 ; i <= n ; i++ )
    {
        cout << i << " " ;
        for ( int j = 1 ; j <= i ; j++ ) cout << j << " " ;
        cout << endl ;
        cin >> pre[i] ;
        if ( pre[i] != pre[i-1] )
        {
            c++ ;
            ans[i] = c ;
            v[c] = i ;
        }
        else BS( 1 , c , i ) ;
    }
    cout << 0 << " " ;
    for ( int i = 1 ; i <= n ; i++ ) cout << ans[i] << " " ;
    cout << endl ;
}
# 결과 실행 시간 메모리 Grader output
1 Runtime error 106 ms 1260 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 95 ms 1320 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 200 KB Output is correct
2 Runtime error 119 ms 1264 KB Execution killed with signal 13
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 86 ms 1260 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 115 ms 1300 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -