結果
問題 |
No.26 シャッフルゲーム
|
ユーザー |
|
提出日時 | 2020-05-06 12:08:15 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 34 ms / 5,000 ms |
コード長 | 323 bytes |
コンパイル時間 | 333 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-06-28 12:46:45 |
合計ジャッジ時間 | 1,288 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
ソースコード
N = int(input()) M = int(input()) ans = N ans_list = [0, 0, 0] ans_list[N - 1] = 1 for i in range(M): change_info = [int(x) for x in input().split()] P = change_info[0] - 1 Q = change_info[1] - 1 tmp = ans_list[P] ans_list[P] = ans_list[Q] ans_list[Q] = tmp print(ans_list.index(1) + 1)