結果

問題 No.1438 Broken Drawers
ユーザー toyuzukotoyuzuko
提出日時 2021-04-20 17:21:16
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 133 ms / 2,000 ms
コード長 266 bytes
コンパイル時間 263 ms
コンパイル使用メモリ 87,140 KB
実行使用メモリ 113,392 KB
最終ジャッジ日時 2023-09-17 08:47:52
合計ジャッジ時間 5,294 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,256 KB
testcase_01 AC 72 ms
71,280 KB
testcase_02 AC 73 ms
71,588 KB
testcase_03 AC 71 ms
71,432 KB
testcase_04 AC 70 ms
71,200 KB
testcase_05 AC 72 ms
71,304 KB
testcase_06 AC 128 ms
110,640 KB
testcase_07 AC 122 ms
110,656 KB
testcase_08 AC 71 ms
71,572 KB
testcase_09 AC 72 ms
71,040 KB
testcase_10 AC 72 ms
71,188 KB
testcase_11 AC 79 ms
76,520 KB
testcase_12 AC 95 ms
90,424 KB
testcase_13 AC 111 ms
100,712 KB
testcase_14 AC 90 ms
85,232 KB
testcase_15 AC 126 ms
106,792 KB
testcase_16 AC 126 ms
113,392 KB
testcase_17 AC 130 ms
109,936 KB
testcase_18 AC 130 ms
110,316 KB
testcase_19 AC 130 ms
110,164 KB
testcase_20 AC 129 ms
110,208 KB
testcase_21 AC 129 ms
110,340 KB
testcase_22 AC 129 ms
110,288 KB
testcase_23 AC 130 ms
110,564 KB
testcase_24 AC 133 ms
110,432 KB
testcase_25 AC 133 ms
110,760 KB
testcase_26 AC 131 ms
110,528 KB
testcase_27 AC 132 ms
110,628 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

pos = [0] * (N + 1)

for i in range(N):
    pos[A[i]] = i + 1

res = []
used = [0] * (N + 1)

for i in range(1, N + 1):
    if not used[pos[i]]:
        res.append(i)
        used[pos[i] - 1] = 1

print(len(res))
0