結果

問題 No.1111 コード進行
ユーザー H3PO4H3PO4
提出日時 2020-07-10 23:00:30
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 432 bytes
コンパイル時間 304 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 44,584 KB
最終ジャッジ日時 2024-04-19 21:52:55
合計ジャッジ時間 30,397 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 452 ms
44,080 KB
testcase_01 AC 446 ms
43,824 KB
testcase_02 AC 452 ms
43,936 KB
testcase_03 AC 455 ms
44,324 KB
testcase_04 AC 458 ms
44,320 KB
testcase_05 AC 456 ms
44,076 KB
testcase_06 AC 459 ms
43,944 KB
testcase_07 AC 466 ms
44,460 KB
testcase_08 AC 459 ms
44,068 KB
testcase_09 AC 466 ms
44,196 KB
testcase_10 AC 460 ms
43,940 KB
testcase_11 AC 471 ms
43,816 KB
testcase_12 AC 473 ms
44,200 KB
testcase_13 AC 458 ms
43,812 KB
testcase_14 AC 468 ms
44,448 KB
testcase_15 AC 463 ms
44,320 KB
testcase_16 AC 475 ms
44,324 KB
testcase_17 AC 449 ms
44,196 KB
testcase_18 AC 458 ms
43,816 KB
testcase_19 AC 459 ms
43,820 KB
testcase_20 AC 449 ms
44,200 KB
testcase_21 AC 451 ms
44,208 KB
testcase_22 AC 449 ms
43,820 KB
testcase_23 AC 449 ms
43,936 KB
testcase_24 AC 456 ms
43,948 KB
testcase_25 AC 473 ms
44,072 KB
testcase_26 AC 471 ms
43,940 KB
testcase_27 AC 466 ms
44,200 KB
testcase_28 AC 469 ms
43,816 KB
testcase_29 AC 479 ms
43,952 KB
testcase_30 WA -
testcase_31 AC 450 ms
44,200 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 AC 471 ms
44,068 KB
testcase_35 AC 470 ms
43,948 KB
testcase_36 AC 742 ms
44,196 KB
testcase_37 AC 645 ms
44,324 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 AC 498 ms
44,200 KB
testcase_42 AC 664 ms
43,808 KB
testcase_43 WA -
testcase_44 AC 494 ms
44,064 KB
testcase_45 AC 526 ms
44,452 KB
testcase_46 WA -
testcase_47 AC 1,142 ms
44,104 KB
testcase_48 AC 847 ms
43,948 KB
testcase_49 AC 688 ms
43,820 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=np.int64)
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