제출 #1354497

#제출 시각아이디문제언어결과실행 시간메모리
1354497yyc000123Guessing Game (EGOI23_guessinggame)C++20
0 / 100
0 ms684 KiB
#include<bits/stdc++.h>
using namespace std ;
const int N = 1e5+5 ;
int p , n ;

void solve1(){
    cout << n-1 << '\n' ;
    for(int i=1 ; i<n ; i++){
        int x ; cin >> x ;
        cout << i << '\n' ;
    }
}

void solve2(){
    map<int,int> mp ;
    for(int i=1 ; i<=n ; i++){
        int x ; cin >> x ;
        if(mp.find(x)!=mp.end()) cout << i << ' ' << mp[x] << '\n' ;
        else mp[x]=i ;
    }
}

int main(){
    ios::sync_with_stdio(0),cin.tie(0),cout.tie(0) ;
    cin >> p >> n ;
    if(p==1) solve1() ;
    else solve2() ;
    return 0 ;
}
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…