結果

問題 No.1 道のショートカット
ユーザー MintMint
提出日時 2015-05-06 22:15:34
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 547 bytes
コンパイル時間 120 ms
コンパイル使用メモリ 6,588 KB
実行使用メモリ 6,240 KB
最終ジャッジ日時 2023-09-22 12:10:00
合計ジャッジ時間 11,795 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
6,124 KB
testcase_01 AC 11 ms
6,008 KB
testcase_02 AC 12 ms
6,080 KB
testcase_03 AC 11 ms
6,064 KB
testcase_04 AC 11 ms
5,996 KB
testcase_05 AC 11 ms
5,924 KB
testcase_06 AC 11 ms
5,952 KB
testcase_07 AC 11 ms
6,012 KB
testcase_08 AC 360 ms
6,240 KB
testcase_09 WA -
testcase_10 AC 2,922 ms
6,108 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 = 1001
	time = 2000
	for i in xrange(0,routes):
		if (t[i] == num) & (y[i] <= money):
			if s[i] == 1:
				time = m[i]
			else:
				time = search(s[i], money - y[i], routes, nowTime+m[i])
		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())

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

print result 
0