結果

問題 No.1268 Fruit Rush 2
ユーザー trineutron
提出日時 2020-10-23 22:47:19
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 195 bytes
コンパイル時間 262 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 34,952 KB
最終ジャッジ日時 2024-07-21 11:49:02
合計ジャッジ時間 7,142 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21 WA * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = sorted(list(map(int, input().split())))
ans = 0
l = 0
for i in range(n):
    l += 1
    ans += l // 2 + 1
    if i < n - 1 and a[i + 1] != a[i] + 1:
        l = 0
print(ans)
0