結果

問題 No.33 アメーバがたくさん
ユーザー KudeKude
提出日時 2020-09-05 19:15:22
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 79 ms / 5,000 ms
コード長 339 bytes
コンパイル時間 285 ms
コンパイル使用メモリ 86,872 KB
実行使用メモリ 71,628 KB
最終ジャッジ日時 2023-08-19 12:56:06
合計ジャッジ時間 2,423 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
71,252 KB
testcase_01 AC 78 ms
71,376 KB
testcase_02 AC 78 ms
71,516 KB
testcase_03 AC 77 ms
71,532 KB
testcase_04 AC 79 ms
71,544 KB
testcase_05 AC 79 ms
71,268 KB
testcase_06 AC 77 ms
71,548 KB
testcase_07 AC 77 ms
71,388 KB
testcase_08 AC 78 ms
71,628 KB
testcase_09 AC 76 ms
71,596 KB
testcase_10 AC 79 ms
71,536 KB
権限があれば一括ダウンロードができます

ソースコード

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