結果

問題 No.1 道のショートカット
ユーザー Snark86Snark86
提出日時 2016-04-27 01:30:23
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 671 bytes
コンパイル時間 151 ms
コンパイル使用メモリ 6,588 KB
実行使用メモリ 13,772 KB
最終ジャッジ日時 2023-09-22 12:43:15
合計ジャッジ時間 9,336 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
5,952 KB
testcase_01 AC 11 ms
5,980 KB
testcase_02 AC 12 ms
5,852 KB
testcase_03 AC 12 ms
5,872 KB
testcase_04 AC 12 ms
5,924 KB
testcase_05 AC 11 ms
6,052 KB
testcase_06 AC 11 ms
5,932 KB
testcase_07 AC 12 ms
5,864 KB
testcase_08 AC 16 ms
6,152 KB
testcase_09 AC 14 ms
6,212 KB
testcase_10 AC 16 ms
6,284 KB
testcase_11 AC 34 ms
6,232 KB
testcase_12 AC 24 ms
6,268 KB
testcase_13 AC 24 ms
6,252 KB
testcase_14 WA -
testcase_15 AC 11 ms
5,912 KB
testcase_16 WA -
testcase_17 AC 12 ms
5,864 KB
testcase_18 AC 11 ms
5,932 KB
testcase_19 AC 12 ms
5,868 KB
testcase_20 AC 15 ms
6,212 KB
testcase_21 AC 12 ms
6,036 KB
testcase_22 AC 12 ms
5,868 KB
testcase_23 AC 1,420 ms
13,772 KB
testcase_24 TLE -
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 #

n = int(raw_input())
c = int(raw_input())
v = int(raw_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())

a = [[c,0,0]]
b = [[] for _ in range(n-1)]
d = [[] for _ in range(n-1)]
for i in range(v):
	b[s[i]-1].append([y[i],m[i],t[i]-1])
ans = []
while a:
	ac,at,ap = a.pop()
	for bi in b[ap]:
		bc,bt,bp = bi
		if ac >= bc:
			if bp == n-1:
				ans.append([ac-bc,at+bt])
			else:
				for dc,dt in d[bp]:
					if ac-bc >= dc and at+bt >= dt: break
				else:
					d[bp].append([ac-bc,at+bt])
					a.append([ac-bc,at+bt,bp])

print sorted(ans,key=lambda x:x[1])[0][1] if ans else -1
0