結果
| 問題 |
No.26 シャッフルゲーム
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-09-08 08:18:14 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 560 bytes |
| コンパイル時間 | 1,709 ms |
| コンパイル使用メモリ | 168,336 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-27 14:51:32 |
| 合計ジャッジ時間 | 2,242 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
ソースコード
/**
@file 026.cpp
@title No.26 シャッフルゲーム - yukicoder
@url https://yukicoder.me/problems/no/26
**/
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
#define ALL(obj) (obj).begin(), (obj).end()
#define REP(i, N) for (int i = 0; i < (N); ++i)
int main() {
int N, M;
cin >> N >> M;
vector<bool> maru(3, false);
maru[N-1] = true;
int P, Q;
REP(i, M) {
cin >> P >> Q;
iter_swap(maru.begin() + P - 1, maru.begin() + Q - 1);
}
REP(i, 3) {
if (maru[i]) cout << i + 1 << endl;
}
return 0;
}