結果
| 問題 | No.26 シャッフルゲーム | 
| コンテスト | |
| ユーザー |  hogeover30 | 
| 提出日時 | 2015-01-29 01:58:52 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 5,000 ms | 
| コード長 | 296 bytes | 
| コンパイル時間 | 456 ms | 
| コンパイル使用メモリ | 57,776 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-06-23 03:44:24 | 
| 合計ジャッジ時間 | 815 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 10 | 
ソースコード
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
    int n, m;
    while (cin>>n>>m) {
        int a[4]={};
        a[n]=1;
        while (m--) {
            int p, q; cin>>p>>q; swap(a[p], a[q]);
        }
        for(int i=1;i<=3;++i) if (a[i]) cout<<i<<endl;
    }
}
            
            
            
        