結果

問題 No.1438 Broken Drawers
ユーザー toyuzuko
提出日時 2021-04-20 17:21:16
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 103 ms / 2,000 ms
コード長 266 bytes
コンパイル時間 147 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 121,516 KB
最終ジャッジ日時 2024-07-04 05:23:06
合計ジャッジ時間 3,433 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

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