結果

問題 No.33 アメーバがたくさん
ユーザー Navier_BoltzmannNavier_Boltzmann
提出日時 2023-06-14 21:30:56
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 111 ms / 5,000 ms
コード長 577 bytes
コンパイル時間 423 ms
コンパイル使用メモリ 87,092 KB
実行使用メモリ 73,032 KB
最終ジャッジ日時 2023-09-05 07:09:38
合計ジャッジ時間 2,560 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 103 ms
72,468 KB
testcase_01 AC 111 ms
72,692 KB
testcase_02 AC 108 ms
72,912 KB
testcase_03 AC 104 ms
72,624 KB
testcase_04 AC 104 ms
72,644 KB
testcase_05 AC 103 ms
72,996 KB
testcase_06 AC 103 ms
72,732 KB
testcase_07 AC 106 ms
72,956 KB
testcase_08 AC 107 ms
72,732 KB
testcase_09 AC 104 ms
72,732 KB
testcase_10 AC 104 ms
73,032 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],2*T+1)
print(ans)
0