結果
問題 | No.1449 新プロランド |
ユーザー | nasubi24 |
提出日時 | 2021-03-31 15:37:21 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 703 bytes |
コンパイル時間 | 329 ms |
コンパイル使用メモリ | 87,248 KB |
実行使用メモリ | 79,048 KB |
最終ジャッジ日時 | 2023-08-25 16:49:05 |
合計ジャッジ時間 | 4,588 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 95 ms
76,612 KB |
testcase_01 | WA | - |
testcase_02 | AC | 119 ms
78,128 KB |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | AC | 113 ms
78,760 KB |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | AC | 112 ms
78,428 KB |
testcase_10 | AC | 112 ms
78,964 KB |
testcase_11 | AC | 114 ms
78,860 KB |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | AC | 96 ms
77,168 KB |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | AC | 96 ms
76,564 KB |
testcase_19 | AC | 96 ms
77,292 KB |
testcase_20 | AC | 95 ms
76,428 KB |
testcase_21 | AC | 108 ms
78,888 KB |
testcase_22 | AC | 100 ms
78,232 KB |
testcase_23 | AC | 108 ms
78,760 KB |
testcase_24 | AC | 120 ms
78,880 KB |
testcase_25 | WA | - |
testcase_26 | WA | - |
testcase_27 | WA | - |
testcase_28 | WA | - |
ソースコード
from collections import deque n,m=map(int,input().split()) ans=[[10**10]*(11**4+200) for _ in range(n)] num=[[] for _ in range(n)] for i in range(m): a,b,c=map(int,input().split()) num[a-1].append([b-1,c]) num[b-1].append([a-1,c]) t=list(map(int,input().split())) ans[0][t[0]]=t[0] queue=deque() queue.append([0,t[0]]) while len(queue)!=0: num1=queue.popleft() h1=num1[0] h2=num1[1] num2=num[h1] num3=ans[h1][h2] for i in range(len(num2)): j=num2[i][0] if h2+t[j]<num2[i][1]: cnt=num3+num2[i][1]//h2+t[j] if ans[j][h2+t[j]]>cnt: ans[j][h2+t[j]]=cnt queue.append([j,h2+t[j]]) print(min(ans[-1]))