結果
| 問題 | No.1438 Broken Drawers | 
| コンテスト | |
| ユーザー |  burita083 | 
| 提出日時 | 2021-03-27 02:58:30 | 
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 344 bytes | 
| コンパイル時間 | 141 ms | 
| コンパイル使用メモリ | 12,544 KB | 
| 実行使用メモリ | 47,788 KB | 
| 最終ジャッジ日時 | 2024-11-29 06:43:39 | 
| 合計ジャッジ時間 | 8,192 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 WA * 2 | 
| other | AC * 6 WA * 19 | 
ソースコード
N = int(input())
A = list(map(int, input().split()))
ban = set()
right = set()
for n in range(N):
  right.add(n+1)
ans = []
ans = set()
for n in range(N):
  current = A[n]
  right.remove(current)
  if not current in ban:
    ans.add(current)
    if current-1 >= 1:
      if not current -1 in ans:
        ban.add(current-1)
print(len(ans))
            
            
            
        