結果

問題 No.1268 Fruit Rush 2
ユーザー chineristACchineristAC
提出日時 2020-10-24 01:32:22
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 238 bytes
コンパイル時間 287 ms
コンパイル使用メモリ 87,100 KB
実行使用メモリ 71,616 KB
最終ジャッジ日時 2023-09-28 19:57:27
合計ジャッジ時間 5,901 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
71,492 KB
testcase_01 AC 72 ms
71,440 KB
testcase_02 AC 73 ms
71,364 KB
testcase_03 AC 73 ms
71,316 KB
testcase_04 AC 74 ms
71,464 KB
testcase_05 AC 75 ms
71,220 KB
testcase_06 AC 74 ms
71,532 KB
testcase_07 AC 75 ms
71,424 KB
testcase_08 AC 76 ms
71,616 KB
testcase_09 AC 75 ms
71,248 KB
testcase_10 AC 75 ms
71,560 KB
testcase_11 AC 76 ms
71,432 KB
testcase_12 AC 76 ms
71,564 KB
testcase_13 AC 73 ms
71,428 KB
testcase_14 AC 75 ms
71,580 KB
testcase_15 AC 75 ms
71,228 KB
testcase_16 TLE -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())

A = list(map(int,input().split()))
A.sort()
dic = {a:0 for a in A}
for a in A[::-1]:
    dic[a] = 1
    if a+2 in dic:
        dic[a] += dic[a+2]

res = N
for a in A:
    if a+1 in A:
        res += dic[a+1]

print(res)
0