結果

問題 No.1268 Fruit Rush 2
コンテスト
ユーザー aaaaaaaaaa2230
提出日時 2020-10-31 17:59:00
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
TLE  
実行時間 -
コード長 275 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 173 ms
コンパイル使用メモリ 85,672 KB
実行使用メモリ 148,472 KB
最終ジャッジ日時 2026-04-03 07:33:41
合計ジャッジ時間 6,064 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 28 TLE * 1 -- * 4
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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