結果

問題 No.1268 Fruit Rush 2
ユーザー tktk_snsntktk_snsn
提出日時 2020-11-30 23:20:24
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 540 ms / 2,000 ms
コード長 193 bytes
コンパイル時間 175 ms
コンパイル使用メモリ 10,596 KB
実行使用メモリ 61,092 KB
最終ジャッジ日時 2023-10-11 03:09:06
合計ジャッジ時間 8,486 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
8,476 KB
testcase_01 AC 17 ms
8,428 KB
testcase_02 AC 19 ms
8,408 KB
testcase_03 AC 19 ms
8,452 KB
testcase_04 AC 18 ms
8,392 KB
testcase_05 AC 18 ms
8,428 KB
testcase_06 AC 18 ms
8,392 KB
testcase_07 AC 17 ms
8,404 KB
testcase_08 AC 18 ms
8,404 KB
testcase_09 AC 17 ms
8,408 KB
testcase_10 AC 18 ms
8,400 KB
testcase_11 AC 18 ms
8,320 KB
testcase_12 AC 18 ms
8,520 KB
testcase_13 AC 18 ms
8,404 KB
testcase_14 AC 18 ms
8,404 KB
testcase_15 AC 18 ms
8,436 KB
testcase_16 AC 234 ms
35,580 KB
testcase_17 AC 207 ms
34,244 KB
testcase_18 AC 220 ms
34,588 KB
testcase_19 AC 214 ms
34,512 KB
testcase_20 AC 210 ms
34,288 KB
testcase_21 AC 209 ms
34,552 KB
testcase_22 AC 229 ms
35,548 KB
testcase_23 AC 233 ms
35,596 KB
testcase_24 AC 223 ms
34,532 KB
testcase_25 AC 205 ms
34,248 KB
testcase_26 AC 486 ms
57,920 KB
testcase_27 AC 540 ms
57,728 KB
testcase_28 AC 521 ms
57,716 KB
testcase_29 AC 494 ms
57,676 KB
testcase_30 AC 495 ms
57,732 KB
testcase_31 AC 307 ms
44,000 KB
testcase_32 AC 311 ms
43,992 KB
testcase_33 AC 247 ms
51,216 KB
testcase_34 AC 255 ms
55,236 KB
testcase_35 AC 283 ms
61,092 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict
N = int(input())
A = list(map(int, input().split()))
A.sort()
d = defaultdict(int)

for a in A:
    d[a] += 1
    d[a + 1] += d[a - 1]
print(sum(d.values()))
0