結果

問題 No.496 ワープクリスタル (給料日前編)
ユーザー 6soukiti296soukiti29
提出日時 2017-03-26 05:53:59
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 99 ms / 2,000 ms
コード長 465 bytes
コンパイル時間 294 ms
コンパイル使用メモリ 10,792 KB
実行使用メモリ 8,360 KB
最終ジャッジ日時 2023-09-20 08:45:31
合計ジャッジ時間 2,351 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,832 KB
testcase_01 AC 16 ms
7,824 KB
testcase_02 AC 16 ms
7,816 KB
testcase_03 AC 16 ms
7,824 KB
testcase_04 AC 16 ms
8,004 KB
testcase_05 AC 17 ms
7,788 KB
testcase_06 AC 16 ms
7,820 KB
testcase_07 AC 16 ms
7,836 KB
testcase_08 AC 86 ms
8,248 KB
testcase_09 AC 16 ms
7,928 KB
testcase_10 AC 23 ms
7,796 KB
testcase_11 AC 18 ms
7,980 KB
testcase_12 AC 20 ms
7,816 KB
testcase_13 AC 21 ms
7,932 KB
testcase_14 AC 16 ms
7,792 KB
testcase_15 AC 16 ms
7,792 KB
testcase_16 AC 18 ms
7,984 KB
testcase_17 AC 18 ms
7,808 KB
testcase_18 AC 17 ms
7,984 KB
testcase_19 AC 18 ms
7,736 KB
testcase_20 AC 16 ms
7,828 KB
testcase_21 AC 17 ms
7,800 KB
testcase_22 AC 50 ms
8,360 KB
testcase_23 AC 99 ms
8,352 KB
testcase_24 AC 35 ms
8,204 KB
testcase_25 AC 23 ms
7,856 KB
testcase_26 AC 36 ms
8,224 KB
権限があれば一括ダウンロードができます

ソースコード

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