제출 #1354499

#제출 시각아이디문제언어결과실행 시간메모리
1354499yyc000123Guessing Game (EGOI23_guessinggame)C++20
10 / 100
446 ms5108 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 << endl ;
    }
}

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

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