結果
| 問題 | No.26 シャッフルゲーム | 
| コンテスト | |
| ユーザー | 👑 | 
| 提出日時 | 2020-01-18 02:00:23 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 5,000 ms | 
| コード長 | 212 bytes | 
| コンパイル時間 | 751 ms | 
| コンパイル使用メモリ | 64,328 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-06-26 05:33:22 | 
| 合計ジャッジ時間 | 1,634 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 10 | 
ソースコード
#include <iostream>
using namespace std;
int main(){
    int n,m;cin>>n>>m;
    for(int i = 0; m > i; i++){
        int a,b;cin>>a>>b;
        if(n==a)n=b;
        else if(n==b)n=a;
    }
    cout << n << endl;
}
            
            
            
        