結果

問題 No.3018 目隠し宝探し
ユーザー gew1fw
提出日時 2025-06-12 13:34:44
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 516 bytes
コンパイル時間 177 ms
コンパイル使用メモリ 82,748 KB
実行使用メモリ 84,796 KB
平均クエリ数 1.00
最終ジャッジ日時 2025-06-12 13:40:14
合計ジャッジ時間 4,733 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample RE * 1
other RE * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
m = int(input())

sum_links = [0.0] * n
edges = []
for _ in range(m):
    a, b, c = map(int, input().split())
    edges.append((a, b, c))
    sum_links[a] += c

processed_edges = []
for a, b, c in edges:
    f = c / sum_links[a]
    processed_edges.append((a, b, f))

current_pop = [10.0] * n

for _ in range(100):
    new_pop = [0.0] * n
    for a, b, f in processed_edges:
        new_pop[b] += current_pop[a] * f
    current_pop = new_pop

for val in current_pop:
    print("{0:.6f}".format(val))
0