結果
| 問題 | No.26 シャッフルゲーム |
| コンテスト | |
| ユーザー |
steek79
|
| 提出日時 | 2015-10-14 23:31:20 |
| 言語 | PyPy2 (7.3.20) |
| 結果 |
AC
|
| 実行時間 | 62 ms / 5,000 ms |
| + 73µs | |
| コード長 | 321 bytes |
| 記録 | |
| コンパイル時間 | 68 ms |
| コンパイル使用メモリ | 81,024 KB |
| 実行使用メモリ | 81,408 KB |
| 最終ジャッジ日時 | 2026-07-17 22:46:44 |
| 合計ジャッジ時間 | 1,691 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
ソースコード
N = input()
M = input()
cups = [0] * 3
cups[N-1] = 1
def move_cups(cups, p, q):
if cups[p-1] + cups[q-1] > 0:
cups[p-1] = (cups[p-1]+1) %2 # 0<->1
cups[q-1] = (cups[q-1]+1) %2 # 1<->0
for m in range(M):
p, q = map(int, raw_input().split())
move_cups(cups, p, q)
print cups.index(1)+1
steek79