結果

問題 No.1111 コード進行
ユーザー H3PO4H3PO4
提出日時 2020-07-10 22:05:37
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 416 bytes
コンパイル時間 292 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 44,540 KB
最終ジャッジ日時 2024-04-19 17:14:28
合計ジャッジ時間 34,758 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 587 ms
44,080 KB
testcase_01 AC 506 ms
44,204 KB
testcase_02 AC 521 ms
44,208 KB
testcase_03 AC 523 ms
44,208 KB
testcase_04 AC 498 ms
43,840 KB
testcase_05 AC 519 ms
44,220 KB
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 AC 597 ms
43,832 KB
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 AC 510 ms
44,212 KB
testcase_27 AC 507 ms
44,076 KB
testcase_28 AC 533 ms
43,952 KB
testcase_29 AC 520 ms
43,952 KB
testcase_30 WA -
testcase_31 AC 528 ms
44,344 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 AC 558 ms
43,956 KB
testcase_35 AC 575 ms
44,208 KB
testcase_36 AC 813 ms
43,956 KB
testcase_37 AC 720 ms
44,212 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 AC 540 ms
44,208 KB
testcase_42 AC 715 ms
44,208 KB
testcase_43 WA -
testcase_44 AC 554 ms
44,212 KB
testcase_45 AC 586 ms
44,092 KB
testcase_46 WA -
testcase_47 AC 1,299 ms
44,216 KB
testcase_48 AC 943 ms
43,956 KB
testcase_49 AC 900 ms
44,084 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np

N, M, K = map(int, input().split())
G = [[] for _ in range(N)]
PQC = [tuple(map(int, input().split())) for _ in range(M)]
MOD = 10 ** 9 + 7

dp = np.zeros((300, K + 1), dtype=int)
dp[:, 0] = 1

for i in range(N - 1):
    new_dp = np.zeros_like(dp)
    for p, q, c in PQC:
        new_dp[q - 1, c:] += dp[p - 1, :K + 1 - c]
        new_dp[q - 1] % MOD
    dp = new_dp
print(dp[:, -1].sum() % MOD)
0