結果

問題 No.123 カードシャッフル
ユーザー lllllll88938494lllllll88938494
提出日時 2023-05-30 03:10:53
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 111 ms / 5,000 ms
コード長 201 bytes
コンパイル時間 248 ms
コンパイル使用メモリ 87,084 KB
実行使用メモリ 89,540 KB
最終ジャッジ日時 2023-08-28 00:22:20
合計ジャッジ時間 2,088 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,352 KB
testcase_01 AC 69 ms
71,224 KB
testcase_02 AC 69 ms
71,380 KB
testcase_03 AC 70 ms
71,156 KB
testcase_04 AC 69 ms
70,996 KB
testcase_05 AC 69 ms
71,312 KB
testcase_06 AC 70 ms
71,272 KB
testcase_07 AC 69 ms
71,148 KB
testcase_08 AC 71 ms
71,448 KB
testcase_09 AC 70 ms
71,176 KB
testcase_10 AC 89 ms
88,772 KB
testcase_11 AC 102 ms
89,508 KB
testcase_12 AC 111 ms
89,528 KB
testcase_13 AC 111 ms
89,540 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m=map(int,input().split())
a=list(map(int,input().split()))
x = [ i for i in range(n,0,-1)]


for i in range(m):
    t=a[i]
    if t == 1:
        continue
    x=x[:-t]+x[-t+1:]+[x[-t]]

print(x[-1])
0