結果

問題 No.123 カードシャッフル
ユーザー togatogatogatoga
提出日時 2015-09-03 09:31:22
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 121 ms / 5,000 ms
コード長 259 bytes
コンパイル時間 1,851 ms
コンパイル使用メモリ 77,588 KB
実行使用メモリ 86,708 KB
最終ジャッジ日時 2023-09-26 02:32:34
合計ジャッジ時間 4,095 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
76,076 KB
testcase_01 AC 79 ms
76,364 KB
testcase_02 AC 79 ms
76,292 KB
testcase_03 AC 80 ms
76,412 KB
testcase_04 AC 78 ms
76,132 KB
testcase_05 AC 78 ms
76,284 KB
testcase_06 AC 85 ms
76,416 KB
testcase_07 AC 80 ms
76,332 KB
testcase_08 AC 82 ms
76,356 KB
testcase_09 AC 81 ms
76,128 KB
testcase_10 AC 108 ms
86,104 KB
testcase_11 AC 121 ms
86,708 KB
testcase_12 AC 116 ms
86,464 KB
testcase_13 AC 118 ms
86,596 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M = map(int, raw_input().split())
A = map(int, raw_input().split())
pos = [0] * (N + 1)
for i in range(1, N + 1):
    pos[i] = i

for x in A:
    tmp = pos[x]
    for y in reversed(range(2, x + 1)):
        pos[y] = pos[y - 1]
    pos[1] = tmp
print pos[1]
0