結果
| 問題 | No.3013 ハチマキ買い星人 | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2025-01-25 13:26:24 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 566 bytes | 
| コンパイル時間 | 228 ms | 
| コンパイル使用メモリ | 81,948 KB | 
| 実行使用メモリ | 159,680 KB | 
| 最終ジャッジ日時 | 2025-01-25 22:46:59 | 
| 合計ジャッジ時間 | 16,047 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 | 
| other | AC * 17 WA * 28 | 
ソースコード
from collections import defaultdict import heapq N,M,P,Y=list(map(int,input().split())) dist=[10**18]*N path=defaultdict(list) for i in range(M): u,v,c=list(map(int,input().split())) u-=1 v-=1 path[u].append((v,c)) path[v].append((u,c)) dist[0]=0 c=set() Q=[] heapq.heapify(Q) heapq.heappush(Q,(0,0)) while len(Q)>0: d,p=heapq.heappop(Q) if p in c: continue c.add(p) for j,v in path[p]: if d+v<dist[j]: heapq.heappush(Q,(j,d+v)) dist[j]=d+v ans=0 for i in range(P): d,e=list(map(int,input().split())) d-=1 ans=max(ans,(Y-dist[d])//e) print(ans)
