結果
| 問題 | No.26 シャッフルゲーム | 
| コンテスト | |
| ユーザー |  kyo1 | 
| 提出日時 | 2020-03-08 05:06:42 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 5,000 ms | 
| コード長 | 430 bytes | 
| コンパイル時間 | 1,580 ms | 
| コンパイル使用メモリ | 168,848 KB | 
| 実行使用メモリ | 6,820 KB | 
| 最終ジャッジ日時 | 2024-11-06 07:20:40 | 
| 合計ジャッジ時間 | 2,225 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 10 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int N, M;
  cin >> N >> M;
  N--;
  vector<bool> mark(3, false);
  mark[N] = true;
  for (int i = 0; i < M; i++) {
    int p, q;
    cin >> p >> q;
    p--, q--;
    bool tmp = mark[p];
    mark[p] = mark[q];
    mark[q] = tmp;
  }
  for (int i = 0; i < 3; i++) {
    if (mark[i]) cout << i + 1 << '\n';
  }
  return 0;
}
            
            
            
        