結果
| 問題 |
No.123 カードシャッフル
|
| コンテスト | |
| ユーザー |
norioc
|
| 提出日時 | 2025-02-13 02:11:41 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 59 ms / 5,000 ms |
| コード長 | 285 bytes |
| コンパイル時間 | 629 ms |
| コンパイル使用メモリ | 82,788 KB |
| 実行使用メモリ | 81,036 KB |
| 最終ジャッジ日時 | 2025-02-13 02:11:44 |
| 合計ジャッジ時間 | 1,701 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 10 |
ソースコード
def f(k: int, inds: list[int]) -> int:
p = k
for x in reversed(inds):
if p == 0:
p = x
elif x >= p:
p -= 1
return p
N, M = map(int, input().split())
A = list(map(lambda x: int(x)-1, input().split()))
ans = f(0, A) + 1
print(ans)
norioc