結果
| 問題 |
No.1473 おでぶなおばけさん
|
| コンテスト | |
| ユーザー |
sasa8uyauya
|
| 提出日時 | 2025-07-22 01:59:33 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 1,151 ms / 2,000 ms |
| コード長 | 420 bytes |
| コンパイル時間 | 465 ms |
| コンパイル使用メモリ | 82,444 KB |
| 実行使用メモリ | 125,176 KB |
| 最終ジャッジ日時 | 2025-07-22 01:59:57 |
| 合計ジャッジ時間 | 23,853 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 47 |
ソースコード
n,m=map(int,input().split())
e=[[] for i in range(n)]
for _ in range(m):
u,v,d=map(int,input().split())
u-=1
v-=1
e[u]+=[(v,d)]
e[v]+=[(u,d)]
def check(w):
v=[-1]*n
q=[0]
v[0]=0
for s in q:
for t,d in e[s]:
if v[t]==-1 and d>=w:
v[t]=v[s]+1
q+=[t]
return v[n-1]
ok=0
ng=10**9+1
while ng-ok>1:
m=(ok+ng)//2
if check(m)!=-1:
ok=m
else:
ng=m
print(ok,check(ok))
sasa8uyauya