結果

問題 No.1438 Broken Drawers
ユーザー 👑 KazunKazun
提出日時 2021-03-26 21:28:02
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 126 ms / 2,000 ms
コード長 231 bytes
コンパイル時間 280 ms
コンパイル使用メモリ 87,184 KB
実行使用メモリ 110,444 KB
最終ジャッジ日時 2023-08-19 07:04:32
合計ジャッジ時間 4,647 ms
ジャッジサーバーID
(参考情報)
judge15 / judge10
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,616 KB
testcase_01 AC 71 ms
71,156 KB
testcase_02 AC 71 ms
71,492 KB
testcase_03 AC 72 ms
71,620 KB
testcase_04 AC 70 ms
71,348 KB
testcase_05 AC 71 ms
71,636 KB
testcase_06 AC 116 ms
110,232 KB
testcase_07 AC 117 ms
110,444 KB
testcase_08 AC 71 ms
71,348 KB
testcase_09 AC 72 ms
71,516 KB
testcase_10 AC 69 ms
71,284 KB
testcase_11 AC 77 ms
76,536 KB
testcase_12 AC 91 ms
87,968 KB
testcase_13 AC 103 ms
96,372 KB
testcase_14 AC 86 ms
83,688 KB
testcase_15 AC 122 ms
106,676 KB
testcase_16 AC 122 ms
106,340 KB
testcase_17 AC 122 ms
109,824 KB
testcase_18 AC 121 ms
109,872 KB
testcase_19 AC 123 ms
110,096 KB
testcase_20 AC 126 ms
110,232 KB
testcase_21 AC 124 ms
109,928 KB
testcase_22 AC 121 ms
110,104 KB
testcase_23 AC 123 ms
110,164 KB
testcase_24 AC 123 ms
110,200 KB
testcase_25 AC 124 ms
110,220 KB
testcase_26 AC 125 ms
110,168 KB
testcase_27 AC 122 ms
110,308 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

Index=[-1]*(N+1)
for i,a in enumerate(A):
    Index[a]=i

Opened=[0]*(N+1)
X=0
for a in range(1,N+1):
    j=Index[a]
    if Opened[j+1]==0:
        X+=1
        Opened[j]=1

print(X)
0