結果
| 問題 | No.1473 おでぶなおばけさん |
| コンテスト | |
| ユーザー |
sasa8uyauya
|
| 提出日時 | 2025-07-22 01:59:33 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 584 ms / 2,000 ms |
| + 44µs | |
| コード長 | 420 bytes |
| 記録 | |
| コンパイル時間 | 231 ms |
| コンパイル使用メモリ | 95,724 KB |
| 実行使用メモリ | 131,884 KB |
| 最終ジャッジ日時 | 2026-07-13 10:34:27 |
| 合計ジャッジ時間 | 16,904 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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