結果
| 問題 |
No.3018 目隠し宝探し
|
| コンテスト | |
| ユーザー |
gew1fw
|
| 提出日時 | 2025-06-12 16:25:12 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 659 bytes |
| コンパイル時間 | 307 ms |
| コンパイル使用メモリ | 82,476 KB |
| 実行使用メモリ | 84,264 KB |
| 平均クエリ数 | 1.00 |
| 最終ジャッジ日時 | 2025-06-12 16:25:17 |
| 合計ジャッジ時間 | 4,633 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 1 |
| other | RE * 21 |
ソースコード
n = int(input())
m = int(input())
links = [[] for _ in range(n)]
sum_c = [0.0 for _ in range(n)]
for _ in range(m):
a, b, c = map(int, input().split())
links[a].append((b, c))
sum_c[a] += c
current = [10.0 for _ in range(n)]
for _ in range(100):
next_state = [0.0] * n
for i in range(n):
pop = current[i]
if pop == 0.0:
continue
s = sum_c[i]
if s == 0:
continue
for b, c in links[i]:
prob = c / s
contribution = pop * prob
next_state[b] += contribution
current = next_state
for value in current:
print("{0:.6f}".format(value))
gew1fw