結果

問題 No.365 ジェンガソート
ユーザー AEn
提出日時 2022-05-13 23:20:18
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 288 bytes
コンパイル時間 294 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 84,480 KB
最終ジャッジ日時 2024-07-22 03:37:29
合計ジャッジ時間 3,926 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 38 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

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