結果

問題 No.1268 Fruit Rush 2
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2020-10-31 17:59:00
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 275 bytes
コンパイル時間 268 ms
コンパイル使用メモリ 87,068 KB
実行使用メモリ 132,932 KB
最終ジャッジ日時 2023-09-29 10:32:03
合計ジャッジ時間 10,098 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,400 KB
testcase_01 AC 70 ms
71,428 KB
testcase_02 AC 70 ms
71,392 KB
testcase_03 AC 72 ms
71,472 KB
testcase_04 AC 71 ms
71,144 KB
testcase_05 AC 70 ms
71,332 KB
testcase_06 AC 70 ms
71,040 KB
testcase_07 AC 69 ms
71,396 KB
testcase_08 AC 69 ms
71,472 KB
testcase_09 AC 70 ms
71,328 KB
testcase_10 AC 69 ms
71,332 KB
testcase_11 AC 69 ms
71,232 KB
testcase_12 AC 70 ms
71,120 KB
testcase_13 AC 68 ms
71,236 KB
testcase_14 AC 70 ms
71,412 KB
testcase_15 AC 74 ms
71,332 KB
testcase_16 AC 173 ms
125,008 KB
testcase_17 AC 149 ms
118,336 KB
testcase_18 AC 158 ms
119,456 KB
testcase_19 AC 162 ms
118,920 KB
testcase_20 AC 160 ms
119,184 KB
testcase_21 AC 164 ms
118,888 KB
testcase_22 AC 170 ms
124,732 KB
testcase_23 AC 169 ms
124,768 KB
testcase_24 AC 158 ms
119,260 KB
testcase_25 AC 156 ms
118,800 KB
testcase_26 AC 194 ms
132,716 KB
testcase_27 AC 194 ms
132,932 KB
testcase_28 AC 196 ms
132,916 KB
testcase_29 AC 192 ms
132,388 KB
testcase_30 AC 194 ms
132,616 KB
testcase_31 TLE -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(map(int,input().split()))
a.sort()

dic = {}
for i in a:
    dic[i] = 1

ans = n
for i in range(1,n):
    if a[i] == a[i-1]+1:
        count = 0
        k = a[i]
        while k+count*2 in dic:
            count += 1
        ans += count

print(ans)
0