結果

問題 No.365 ジェンガソート
コンテスト
ユーザー AEn
提出日時 2022-05-13 23:20:18
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WA  
実行時間 -
コード長 288 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 333 ms
コンパイル使用メモリ 85,196 KB
実行使用メモリ 86,460 KB
最終ジャッジ日時 2026-04-03 07:15:06
合計ジャッジ時間 5,085 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge5_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 38 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

N = int(input())
A = list(map(int, input().split()))
isok = [False]*N
num = N
for i in reversed(range(N)):
    if A[i] == num:
        isok[num-1] = True
        num -= 1

res = 0
for i in reversed(range(N)):
    if isok[i]:
        res += 1
    else:
        print(N-res)
        exit()
0