結果

問題 No.365 ジェンガソート
ユーザー AEnAEn
提出日時 2022-05-13 23:21:10
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 103 ms / 2,000 ms
コード長 301 bytes
コンパイル時間 297 ms
コンパイル使用メモリ 87,000 KB
実行使用メモリ 90,956 KB
最終ジャッジ日時 2023-09-29 09:02:40
合計ジャッジ時間 5,675 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,128 KB
testcase_01 AC 71 ms
71,084 KB
testcase_02 AC 78 ms
71,540 KB
testcase_03 AC 71 ms
71,276 KB
testcase_04 AC 71 ms
71,420 KB
testcase_05 AC 73 ms
71,496 KB
testcase_06 AC 71 ms
71,032 KB
testcase_07 AC 73 ms
71,312 KB
testcase_08 AC 72 ms
71,264 KB
testcase_09 AC 72 ms
71,272 KB
testcase_10 AC 74 ms
71,312 KB
testcase_11 AC 72 ms
71,320 KB
testcase_12 AC 73 ms
71,536 KB
testcase_13 AC 73 ms
71,388 KB
testcase_14 AC 73 ms
71,256 KB
testcase_15 AC 74 ms
71,220 KB
testcase_16 AC 94 ms
87,288 KB
testcase_17 AC 101 ms
90,828 KB
testcase_18 AC 81 ms
76,496 KB
testcase_19 AC 103 ms
90,584 KB
testcase_20 AC 91 ms
79,184 KB
testcase_21 AC 83 ms
77,916 KB
testcase_22 AC 94 ms
87,172 KB
testcase_23 AC 89 ms
81,444 KB
testcase_24 AC 90 ms
85,968 KB
testcase_25 AC 81 ms
77,464 KB
testcase_26 AC 88 ms
83,504 KB
testcase_27 AC 99 ms
90,800 KB
testcase_28 AC 93 ms
84,252 KB
testcase_29 AC 94 ms
88,980 KB
testcase_30 AC 91 ms
84,368 KB
testcase_31 AC 82 ms
78,720 KB
testcase_32 AC 84 ms
78,832 KB
testcase_33 AC 99 ms
90,956 KB
testcase_34 AC 81 ms
76,548 KB
testcase_35 AC 93 ms
85,884 KB
testcase_36 AC 99 ms
90,900 KB
testcase_37 AC 95 ms
90,856 KB
testcase_38 AC 95 ms
90,880 KB
testcase_39 AC 99 ms
90,912 KB
testcase_40 AC 99 ms
90,924 KB
権限があれば一括ダウンロードができます

ソースコード

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()
print(N-res)
0