結果

問題 No.26 シャッフルゲーム
ユーザー convexineqconvexineq
提出日時 2020-11-22 22:37:52
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 78 ms / 5,000 ms
コード長 262 bytes
コンパイル時間 737 ms
コンパイル使用メモリ 86,920 KB
実行使用メモリ 71,420 KB
最終ジャッジ日時 2023-09-30 23:05:44
合計ジャッジ時間 2,311 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,200 KB
testcase_01 AC 72 ms
71,372 KB
testcase_02 AC 78 ms
71,220 KB
testcase_03 AC 72 ms
71,160 KB
testcase_04 AC 78 ms
71,232 KB
testcase_05 AC 74 ms
71,296 KB
testcase_06 AC 74 ms
71,236 KB
testcase_07 AC 73 ms
71,236 KB
testcase_08 AC 74 ms
71,420 KB
testcase_09 AC 73 ms
71,356 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
# Your code here!
import sys
readline = sys.stdin.readline
read = sys.stdin.read

n = int(readline())
q = int(readline())
r = [0,0,0,0]
r[n] = 1
for _ in range(q):
    z,w = map(int,readline().split())
    r[z],r[w] = r[w],r[z]

print(r.index(1))
0