結果

問題 No.1438 Broken Drawers
ユーザー burita083burita083
提出日時 2021-03-27 02:58:30
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 344 bytes
コンパイル時間 1,181 ms
コンパイル使用メモリ 10,576 KB
実行使用メモリ 44,200 KB
最終ジャッジ日時 2023-08-19 13:34:26
合計ジャッジ時間 7,807 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,888 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 16 ms
7,932 KB
testcase_04 AC 16 ms
7,808 KB
testcase_05 AC 18 ms
7,804 KB
testcase_06 AC 235 ms
44,200 KB
testcase_07 AC 211 ms
44,140 KB
testcase_08 WA -
testcase_09 AC 16 ms
7,760 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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))
0