제출 #1354426

#제출 시각아이디문제언어결과실행 시간메모리
1354426branches1029Guessing Game (EGOI23_guessinggame)C++20
0 / 100
359 ms856 KiB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int o, n;
int cnt;
int used[100005];

void Anna(){
    cout << 99999 << endl;
    for( int i=1 ; i<n ; i++ ){
        int x;
        cin >> x;
        cnt++;
        cout << cnt << endl;
    }
}

void Bertil(){
    for( int i=1 ; i<=99999 ; i++ ) used[i]=-1;
    for( int i=0 ; i<n ; i++ ){
        int a;
        cin >> a;
        if( used[a]==-1 ) used[a]=i;
        else{
            cout << used[a] << ' ' << i << endl;
            break;
        }
    }
}

int main(){

    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

    cin >> o >> n;
    if( o==1 ) Anna();
    else Bertil();

    return 0;
}
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…