結果
| 問題 | No.26 シャッフルゲーム | 
| コンテスト | |
| ユーザー | 👑 | 
| 提出日時 | 2022-08-08 09:59:19 | 
| 言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 23 ms / 5,000 ms | 
| コード長 | 445 bytes | 
| コンパイル時間 | 712 ms | 
| コンパイル使用メモリ | 70,396 KB | 
| 最終ジャッジ日時 | 2025-01-30 19:24:40 | 
| ジャッジサーバーID (参考情報) | judge3 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 10 | 
ソースコード
#include <iostream>
#include <list>
#include <vector>
#include <string>
#include <stdio.h>
#include <stdint.h>
using namespace std;
using uint = unsigned int;
using ll = long long;
int main()
{
  ll N;
  ll M;
  cin >> N;
  cin >> M;
  ll P;
  ll Q;
  for( ll i = 0 ; i < M ; i++ ){
    cin >> P;
    cin >> Q;
    if( N == P ){
      N = Q;
    } else if( N == Q ) {
      N = P;
      
    }
  }
  cout << N << endl;
  return 0;
}
            
            
            
        