結果

問題 No.1 道のショートカット
ユーザー MintMint
提出日時 2015-05-06 22:40:02
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 627 bytes
コンパイル時間 835 ms
コンパイル使用メモリ 6,676 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2023-09-22 12:09:48
合計ジャッジ時間 8,630 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
6,056 KB
testcase_01 AC 11 ms
5,960 KB
testcase_02 AC 11 ms
5,964 KB
testcase_03 AC 12 ms
6,100 KB
testcase_04 AC 12 ms
6,052 KB
testcase_05 AC 10 ms
6,024 KB
testcase_06 AC 11 ms
6,068 KB
testcase_07 AC 10 ms
6,124 KB
testcase_08 AC 157 ms
6,224 KB
testcase_09 WA -
testcase_10 AC 732 ms
6,212 KB
testcase_11 TLE -
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 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

def search(num, money, routes, nowTime):
	minTime = 10000000000
	time = minTime*2
	for i in xrange(0,routes):
		if (x[i][1] == num) & (x[i][2] <= money):
			if x[i][0] == 1:
				time = x[i][3]
			else:
				time = search(x[i][0], money - x[i][2], i, nowTime+x[i][3])
		if time < minTime:
			minTime = time
	return minTime+nowTime

n = input()
c = input()
v = input()
s = map(int, raw_input().split())
t = map(int, raw_input().split())
y = map(int, raw_input().split())
m = map(int, raw_input().split())

x = sorted(zip(s,t,y,m), key=lambda x:x[1])

result = search(n,c,v,0)
if result == 10000000000:
	result = -1

print result 
0