結果

問題 No.33 アメーバがたくさん
ユーザー Kude
提出日時 2020-09-05 19:15:22
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 50 ms / 5,000 ms
コード長 339 bytes
コンパイル時間 160 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 53,760 KB
最終ジャッジ日時 2024-11-29 05:57:14
合計ジャッジ時間 1,409 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

n, d, t = map(int, input().split())
from collections import defaultdict
dic = defaultdict(list)
for x in map(int, input().split()):
    xq, xr = divmod(x, d)
    dic[xr].append(xq)
ans = 0
for xs in dic.values():
    xs.sort()
    nxt = -10**18
    for x in xs:
        ans += x + t - max(nxt, x - t) + 1
        nxt = x + t + 1
print(ans)
0