結果

問題 No.33 アメーバがたくさん
ユーザー dangodango
提出日時 2023-07-09 15:54:51
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 78 ms / 5,000 ms
コード長 426 bytes
コンパイル時間 328 ms
コンパイル使用メモリ 87,112 KB
実行使用メモリ 71,620 KB
最終ジャッジ日時 2023-09-30 19:16:02
合計ジャッジ時間 1,956 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,424 KB
testcase_01 AC 76 ms
71,288 KB
testcase_02 AC 77 ms
71,484 KB
testcase_03 AC 76 ms
71,244 KB
testcase_04 AC 78 ms
71,484 KB
testcase_05 AC 77 ms
71,092 KB
testcase_06 AC 76 ms
71,340 KB
testcase_07 AC 75 ms
71,204 KB
testcase_08 AC 74 ms
71,428 KB
testcase_09 AC 75 ms
71,620 KB
testcase_10 AC 75 ms
71,208 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, d, t = map(int, input().split())
dic = dict()
for i in map(int, input().split()):
    j = (i % d + d) % d
    if j in dic:
        dic[j].append(i)
    else:
        dic[j] = [i]
res = 0
for k, v in dic.items():
    v.sort()
    res += len(v) + t * 2
    for i in range(len(v) - 1):
        if v[i] + t * d < v[i + 1] - t * d:
            res += t * 2
        else:
            res += (v[i + 1] - v[i]) // d - 1
print(res)
0