結果

問題 No.496 ワープクリスタル (給料日前編)
コンテスト
ユーザー 6soukiti29
提出日時 2017-03-26 05:53:59
言語 Python3
(3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 465 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 65 ms
コンパイル使用メモリ 15,232 KB
実行使用メモリ 12,928 KB
最終ジャッジ日時 2026-10-14 15:25:37
合計ジャッジ時間 7,664 ms
ジャッジサーバーID
(参考情報)
judge4_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 23 TLE * 1
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

Gx,Gy,N,F = map(int,input().split())
L = []
P = [[0,0,0]]
for n in range(N):
	x,y,c = list(map(int,input().split()))
	if c / (x + y) > F:
		pass
	else:
		pi = len(P)
		for i,p in enumerate(P):
			if x + p[0] <= Gx and y + p[1] <= Gy and i < pi:
				x2 = p[0] + x
				y2 = p[1] + y
				c2 = p[2] + c
				if [x2, y2, c2] not in P:
					P.append([x2,y2,c2])
m = float("inf")
for p in P:
	x = Gx - p[0]
	y = Gy - p[1]
	c = (x + y) * F + p[2]
	if c < m:
		m = c
print(m)
0