結果

問題 No.33 アメーバがたくさん
ユーザー ytftytft
提出日時 2022-11-04 06:46:46
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 74 ms / 5,000 ms
コード長 360 bytes
コンパイル時間 384 ms
コンパイル使用メモリ 86,764 KB
実行使用メモリ 71,484 KB
最終ジャッジ日時 2023-09-25 11:47:20
合計ジャッジ時間 1,786 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,396 KB
testcase_01 AC 70 ms
71,480 KB
testcase_02 AC 69 ms
71,484 KB
testcase_03 AC 69 ms
71,340 KB
testcase_04 AC 70 ms
71,476 KB
testcase_05 AC 69 ms
70,908 KB
testcase_06 AC 69 ms
71,276 KB
testcase_07 AC 73 ms
70,936 KB
testcase_08 AC 71 ms
71,224 KB
testcase_09 AC 71 ms
70,932 KB
testcase_10 AC 73 ms
71,472 KB
権限があれば一括ダウンロードができます

ソースコード

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 X:
	if not i%D in pos:
		pos[i%D]=[]
	pos[i%D].append(i//D)
for i in pos:
	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