結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 558 ms
43,692 KB
testcase_01 AC 551 ms
44,068 KB
testcase_02 AC 558 ms
43,692 KB
testcase_03 AC 545 ms
43,688 KB
testcase_04 AC 551 ms
44,204 KB
testcase_05 AC 553 ms
44,080 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 564 ms
43,816 KB
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 AC 559 ms
43,812 KB
testcase_27 AC 556 ms
43,700 KB
testcase_28 AC 743 ms
43,696 KB
testcase_29 AC 620 ms
44,084 KB
testcase_30 AC 683 ms
44,076 KB
testcase_31 AC 570 ms
44,076 KB
testcase_32 AC 717 ms
44,332 KB
testcase_33 AC 655 ms
43,696 KB
testcase_34 AC 670 ms
43,692 KB
testcase_35 AC 716 ms
44,072 KB
testcase_36 AC 812 ms
43,948 KB
testcase_37 AC 678 ms
44,068 KB
testcase_38 AC 649 ms
44,208 KB
testcase_39 AC 767 ms
44,164 KB
testcase_40 AC 788 ms
43,944 KB
testcase_41 AC 777 ms
44,076 KB
testcase_42 AC 719 ms
43,696 KB
testcase_43 AC 718 ms
44,076 KB
testcase_44 AC 614 ms
44,068 KB
testcase_45 AC 706 ms
43,692 KB
testcase_46 AC 804 ms
44,200 KB
testcase_47 AC 1,116 ms
43,692 KB
testcase_48 AC 813 ms
44,076 KB
testcase_49 AC 770 ms
44,072 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]
    dp = new_dp % MOD
print(dp[:, -1].sum() % MOD)
0