답안 #995885

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
995885 2024-06-10T03:23:22 Z vjudge1 사육제 (CEOI14_carnival) C++17
0 / 100
10 ms 344 KB
#include <bits/stdc++.h>
using namespace std;
 
#define ll long long
#define pll pair<long long, long long>
#define pb push_back
#define F first
#define S second  
#define all(x) (x).begin(), (x).end()
 
const ll N = 2e5 + 100;
const ll inf = 1e18;
const ll mod = 1e9 + 7;
const ll block = 500;
const ll base = 31;
ll n;
ll p[N], a[N];
void to_nho_cau(){
    cin >> n;
    ll d = 1;
    a[1] = 1;
    for(int i = 2; i <= n;i++){
        ll l = 1, r = i - 1, res = -1;
        while(l <= r){
            ll mid = (l + r) / 2;
            cout << i - mid + 1 << ' ';
            for(int j = mid; j <= i;j++) cout << j << ' ';
            cout << endl;
            ll x; cin >> x;
            cout << i - mid << ' ';
            for(int j = mid; j <= i - 1;j++) cout << j << ' ';
            cout << endl;
            ll y; cin >> y;
            if(x == y){
                res = mid;
                l = mid + 1;
            }
            else r = mid - 1;
        }
        if(res == -1) a[i] = ++d;
        else a[i] = a[res];
    }
    for(int i = 1; i <= n;i++) cout << a[i] << ' ';
}           

signed main()
{   
    ios_base::sync_with_stdio(0); 
    cin.tie(0);
    int t = 1;
    //cin >> t;
    while(t--) to_nho_cau();
    return 0;
}  
# 결과 실행 시간 메모리 Grader output
1 Incorrect 7 ms 344 KB Same person came twice to the party.
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 10 ms 344 KB Same person came twice to the party.
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 6 ms 344 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 8 ms 344 KB Same person came twice to the party.
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 10 ms 344 KB Same person came twice to the party.
2 Halted 0 ms 0 KB -