結果

問題 No.1111 コード進行
ユーザー H3PO4H3PO4
提出日時 2020-07-10 22:55:23
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 427 bytes
コンパイル時間 79 ms
コンパイル使用メモリ 10,748 KB
実行使用メモリ 30,700 KB
最終ジャッジ日時 2023-08-01 18:57:02
合計ジャッジ時間 13,200 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 128 ms
29,380 KB
testcase_01 AC 131 ms
29,536 KB
testcase_02 AC 128 ms
29,440 KB
testcase_03 AC 128 ms
29,528 KB
testcase_04 AC 127 ms
29,404 KB
testcase_05 AC 131 ms
30,508 KB
testcase_06 AC 139 ms
30,000 KB
testcase_07 AC 136 ms
29,828 KB
testcase_08 AC 131 ms
29,788 KB
testcase_09 AC 133 ms
30,548 KB
testcase_10 AC 137 ms
29,972 KB
testcase_11 AC 130 ms
29,764 KB
testcase_12 AC 140 ms
30,588 KB
testcase_13 AC 131 ms
30,060 KB
testcase_14 AC 148 ms
30,428 KB
testcase_15 AC 131 ms
29,460 KB
testcase_16 AC 143 ms
30,308 KB
testcase_17 AC 135 ms
30,048 KB
testcase_18 AC 132 ms
29,780 KB
testcase_19 AC 131 ms
30,068 KB
testcase_20 AC 137 ms
30,220 KB
testcase_21 AC 137 ms
29,432 KB
testcase_22 AC 132 ms
30,008 KB
testcase_23 AC 132 ms
29,588 KB
testcase_24 AC 133 ms
30,096 KB
testcase_25 AC 151 ms
30,088 KB
testcase_26 AC 146 ms
29,924 KB
testcase_27 AC 131 ms
29,992 KB
testcase_28 AC 144 ms
30,444 KB
testcase_29 AC 154 ms
29,628 KB
testcase_30 WA -
testcase_31 AC 135 ms
30,216 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 AC 142 ms
30,272 KB
testcase_35 AC 147 ms
30,040 KB
testcase_36 AC 415 ms
30,620 KB
testcase_37 AC 310 ms
29,780 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 AC 170 ms
30,276 KB
testcase_42 AC 324 ms
30,000 KB
testcase_43 WA -
testcase_44 AC 178 ms
29,932 KB
testcase_45 AC 206 ms
30,044 KB
testcase_46 WA -
testcase_47 AC 836 ms
30,700 KB
testcase_48 AC 530 ms
29,524 KB
testcase_49 AC 359 ms
29,480 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np

N, M, K = map(int, input().split())
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:
        if c > K:
            continue
        new_dp[q - 1, c:] += dp[p - 1, :K + 1 - c]
        new_dp[q - 1] % MOD
    dp = new_dp
print(sum(dp[:, -1]) % MOD)
0