結果

問題 No.33 アメーバがたくさん
ユーザー Navier_BoltzmannNavier_Boltzmann
提出日時 2023-06-14 21:26:41
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 575 bytes
コンパイル時間 1,501 ms
コンパイル使用メモリ 86,700 KB
実行使用メモリ 73,044 KB
最終ジャッジ日時 2023-09-05 07:07:46
合計ジャッジ時間 3,267 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
72,272 KB
testcase_01 AC 114 ms
72,244 KB
testcase_02 AC 113 ms
72,604 KB
testcase_03 WA -
testcase_04 AC 115 ms
72,132 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 115 ms
72,272 KB
testcase_09 WA -
testcase_10 AC 114 ms
72,272 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# import pypyjit
# pypyjit.set_param('max_unroll_recursion=-1')
from collections import *
from itertools import *
from functools import *
from heapq import *
import sys,math
input = sys.stdin.readline

N,D,T = map(int,input().split())
X = list(map(int,input().split()))
Y = defaultdict(lambda:[])
for x in X:
    q,r = divmod(x,D)
    Y[r].append(q)
    
ans = 0
for y in Y.values():
    
    if len(y)==1:
        ans += 2*T+1
        continue
    
    y.sort()
    n = len(y)
    ans += 2*T+1
    for j in range(n-1):
        
        ans += min(y[j+1]-y[j],T+1)
print(ans)
0