結果

問題 No.1438 Broken Drawers
ユーザー burita083burita083
提出日時 2021-03-26 21:59:49
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 335 bytes
コンパイル時間 368 ms
コンパイル使用メモリ 10,608 KB
実行使用メモリ 39,048 KB
最終ジャッジ日時 2023-08-19 08:16:45
合計ジャッジ時間 4,551 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
12,212 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 16 ms
7,796 KB
testcase_04 AC 15 ms
7,876 KB
testcase_05 AC 15 ms
7,908 KB
testcase_06 TLE -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())

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

ban = set()
right = set()
for n in range(N):
  right.add(n+1)

ans = []
for n in range(N):
  current = A[n]
  right.remove(current)
  if not current in ban:
    ans.append(current)
    if current-1 >= 1:
      if not current -1 in ans:
        ban.add(current-1)

print(len(ans))
0