結果
問題 | No.1 道のショートカット |
ユーザー |
|
提出日時 | 2015-05-06 22:20:42 |
言語 | Python2 (2.7.18) |
結果 |
WA
|
実行時間 | - |
コード長 | 559 bytes |
コンパイル時間 | 61 ms |
コンパイル使用メモリ | 6,684 KB |
実行使用メモリ | 8,760 KB |
最終ジャッジ日時 | 2023-09-22 12:10:26 |
合計ジャッジ時間 | 10,524 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 12 ms
6,204 KB |
testcase_01 | AC | 12 ms
6,072 KB |
testcase_02 | AC | 12 ms
6,152 KB |
testcase_03 | WA | - |
testcase_04 | AC | 12 ms
6,212 KB |
testcase_05 | AC | 12 ms
5,972 KB |
testcase_06 | WA | - |
testcase_07 | AC | 11 ms
6,200 KB |
testcase_08 | AC | 353 ms
6,108 KB |
testcase_09 | WA | - |
testcase_10 | AC | 2,907 ms
6,080 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 | -- | - |
ソースコード
def search(num, money, routes, nowTime): minTime = 10000000000 time = minTime*2 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