結果

問題 No.365 ジェンガソート
ユーザー UEUEUE66
提出日時 2019-07-17 17:33:51
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 73 ms / 2,000 ms
コード長 216 bytes
コンパイル時間 234 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 20,644 KB
最終ジャッジ日時 2024-12-22 23:03:10
合計ジャッジ時間 4,089 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 41
権限があれば一括ダウンロードができます

ソースコード

diff #

def jenga_sort(n, a):
    ans = n
    for i in reversed(range(n)):
        if a[i] == ans:
            ans -= 1
    return ans


N = int(input())
A = list(map(int, input().split()))
count = 0

print(jenga_sort(N, A))
0