結果

問題 No.123 カードシャッフル
ユーザー あかりきあかりき
提出日時 2021-02-12 11:43:31
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 98 ms / 5,000 ms
コード長 170 bytes
コンパイル時間 654 ms
コンパイル使用メモリ 87,076 KB
実行使用メモリ 89,532 KB
最終ジャッジ日時 2023-09-26 11:16:03
合計ジャッジ時間 2,641 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,252 KB
testcase_01 AC 73 ms
71,252 KB
testcase_02 AC 72 ms
71,292 KB
testcase_03 AC 73 ms
71,268 KB
testcase_04 AC 74 ms
71,360 KB
testcase_05 AC 71 ms
71,440 KB
testcase_06 AC 73 ms
71,108 KB
testcase_07 AC 75 ms
71,216 KB
testcase_08 AC 74 ms
71,592 KB
testcase_09 AC 76 ms
71,320 KB
testcase_10 AC 93 ms
89,132 KB
testcase_11 AC 95 ms
89,532 KB
testcase_12 AC 98 ms
89,380 KB
testcase_13 AC 98 ms
89,364 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m=map(int,input().split())
a=list(map(int,input().split()))
a.reverse()
ans=0
for i in range(m):
  if ans==0:
    ans=a[i]-1
  elif ans<=a[i]-1:
    ans-=1
print(ans+1)
0