結果
| 問題 | No.1438 Broken Drawers | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2022-05-20 00:43:29 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 101 ms / 2,000 ms | 
| コード長 | 287 bytes | 
| コンパイル時間 | 265 ms | 
| コンパイル使用メモリ | 82,560 KB | 
| 実行使用メモリ | 106,624 KB | 
| 最終ジャッジ日時 | 2024-09-19 05:34:31 | 
| 合計ジャッジ時間 | 4,296 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 25 | 
ソースコード
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)
            
            
            
        