結果
問題 | No.30 たこやき工場 |
ユーザー |
![]() |
提出日時 | 2025-02-06 21:43:01 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 457 bytes |
コンパイル時間 | 1,546 ms |
コンパイル使用メモリ | 82,432 KB |
実行使用メモリ | 70,272 KB |
最終ジャッジ日時 | 2025-02-06 21:43:06 |
合計ジャッジ時間 | 3,528 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 11 WA * 6 |
ソースコード
N = int(input())M = int(input())E = [[] for _ in range(N)]D = [0] * Ndp = [0] * Ndp[N - 1] = 1for i in range(M):p,r,q = map(int,input().split())p -= 1q -= 1E[q].append((p,r))D[p] += 1Q = [N-1]while Q:x = Q.pop()for y,r in E[x]:D[y] -= 1dp[y] += r * dp[x]if D[y] == 0:Q.append(y)for i in range(N-1):if len(E[i]) == 0:print(dp[i])else:print(0)