結果

問題 No.1438 Broken Drawers
ユーザー kohei2019kohei2019
提出日時 2022-05-20 00:43:29
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 97 ms / 2,000 ms
コード長 287 bytes
コンパイル時間 162 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 105,968 KB
最終ジャッジ日時 2023-10-19 09:22:20
合計ジャッジ時間 4,049 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
53,284 KB
testcase_01 AC 38 ms
53,284 KB
testcase_02 AC 36 ms
53,284 KB
testcase_03 AC 38 ms
53,284 KB
testcase_04 AC 38 ms
53,284 KB
testcase_05 AC 38 ms
53,284 KB
testcase_06 AC 94 ms
105,968 KB
testcase_07 AC 87 ms
105,968 KB
testcase_08 AC 38 ms
53,284 KB
testcase_09 AC 38 ms
53,284 KB
testcase_10 AC 38 ms
53,284 KB
testcase_11 AC 47 ms
61,916 KB
testcase_12 AC 61 ms
77,456 KB
testcase_13 AC 71 ms
87,912 KB
testcase_14 AC 56 ms
73,236 KB
testcase_15 AC 87 ms
102,208 KB
testcase_16 AC 88 ms
101,980 KB
testcase_17 AC 95 ms
105,476 KB
testcase_18 AC 93 ms
105,632 KB
testcase_19 AC 94 ms
105,704 KB
testcase_20 AC 93 ms
105,764 KB
testcase_21 AC 93 ms
105,560 KB
testcase_22 AC 94 ms
105,824 KB
testcase_23 AC 94 ms
105,968 KB
testcase_24 AC 94 ms
105,968 KB
testcase_25 AC 97 ms
105,968 KB
testcase_26 AC 95 ms
105,968 KB
testcase_27 AC 95 ms
105,968 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
lsa = list(map(int,input().split()))
used = [False]*(N)
so = [0]*(N)
for i in range(N):
    so[lsa[i]-1] = i

ans = 0
for i in range(N):
    if used[so[i]]:
        continue
    used[so[i]] = True
    if so[i] != 0:
        used[so[i]-1] = True
    ans += 1
print(ans)

0