結果

問題 No.33 アメーバがたくさん
ユーザー ytftytft
提出日時 2022-11-04 06:45:21
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 351 bytes
コンパイル時間 269 ms
コンパイル使用メモリ 87,284 KB
実行使用メモリ 80,336 KB
最終ジャッジ日時 2023-09-25 11:45:52
合計ジャッジ時間 2,112 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,160 KB
testcase_01 AC 71 ms
71,384 KB
testcase_02 AC 71 ms
71,092 KB
testcase_03 AC 70 ms
71,316 KB
testcase_04 AC 71 ms
71,344 KB
testcase_05 AC 68 ms
70,916 KB
testcase_06 AC 69 ms
71,092 KB
testcase_07 AC 69 ms
71,456 KB
testcase_08 RE -
testcase_09 AC 69 ms
71,344 KB
testcase_10 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=lambda:sys.stdin.readline().rstrip()
N,D,T=map(int,input().split())
X=list(map(int,input().split()))
ans=N
pos=[[] for i in range(D)]
for i in X:
	pos[i%D].append(i//D)
for i in range(D):
	pos[i]=sorted(pos[i])
	if len(pos[i])==0:
		continue
	ans+=2*T
	for j in range(len(pos[i])-1):
		ans+=min(2*T,pos[i][j+1]-pos[i][j]-1)
print(ans)
0