結果

問題 No.496 ワープクリスタル (給料日前編)
ユーザー 6soukiti296soukiti29
提出日時 2017-03-25 01:30:51
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
TLE  
実行時間 -
コード長 392 bytes
コンパイル時間 848 ms
コンパイル使用メモリ 10,784 KB
実行使用メモリ 7,920 KB
最終ジャッジ日時 2023-09-20 07:29:36
合計ジャッジ時間 4,313 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,776 KB
testcase_01 AC 16 ms
7,776 KB
testcase_02 AC 16 ms
7,788 KB
testcase_03 AC 16 ms
7,828 KB
testcase_04 AC 16 ms
7,756 KB
testcase_05 AC 17 ms
7,760 KB
testcase_06 AC 16 ms
7,708 KB
testcase_07 AC 16 ms
7,920 KB
testcase_08 TLE -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

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()))
	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
			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