結果

問題 No.1111 コード進行
ユーザー brthyyjpbrthyyjp
提出日時 2020-07-10 22:18:10
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,222 ms / 2,000 ms
コード長 619 bytes
コンパイル時間 302 ms
コンパイル使用メモリ 86,864 KB
実行使用メモリ 336,836 KB
最終ジャッジ日時 2023-08-01 18:19:18
合計ジャッジ時間 11,378 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
75,484 KB
testcase_01 AC 73 ms
71,384 KB
testcase_02 AC 74 ms
71,232 KB
testcase_03 AC 76 ms
71,000 KB
testcase_04 AC 74 ms
71,184 KB
testcase_05 AC 79 ms
75,772 KB
testcase_06 AC 89 ms
76,160 KB
testcase_07 AC 87 ms
76,256 KB
testcase_08 AC 86 ms
76,228 KB
testcase_09 AC 85 ms
76,304 KB
testcase_10 AC 89 ms
76,596 KB
testcase_11 AC 85 ms
76,416 KB
testcase_12 AC 89 ms
76,524 KB
testcase_13 AC 84 ms
76,160 KB
testcase_14 AC 91 ms
76,420 KB
testcase_15 AC 85 ms
76,512 KB
testcase_16 AC 91 ms
76,464 KB
testcase_17 AC 86 ms
76,308 KB
testcase_18 AC 80 ms
75,924 KB
testcase_19 AC 78 ms
75,792 KB
testcase_20 AC 81 ms
76,052 KB
testcase_21 AC 82 ms
76,380 KB
testcase_22 AC 87 ms
76,524 KB
testcase_23 AC 90 ms
76,400 KB
testcase_24 AC 86 ms
76,320 KB
testcase_25 AC 95 ms
76,404 KB
testcase_26 AC 90 ms
76,424 KB
testcase_27 AC 81 ms
75,988 KB
testcase_28 AC 194 ms
181,532 KB
testcase_29 AC 136 ms
112,688 KB
testcase_30 AC 310 ms
172,076 KB
testcase_31 AC 98 ms
89,036 KB
testcase_32 AC 473 ms
188,280 KB
testcase_33 AC 445 ms
150,324 KB
testcase_34 AC 176 ms
156,476 KB
testcase_35 AC 198 ms
180,680 KB
testcase_36 AC 312 ms
181,220 KB
testcase_37 AC 160 ms
106,064 KB
testcase_38 AC 273 ms
119,548 KB
testcase_39 AC 724 ms
246,128 KB
testcase_40 AC 695 ms
285,624 KB
testcase_41 AC 228 ms
199,820 KB
testcase_42 AC 205 ms
128,164 KB
testcase_43 AC 449 ms
190,756 KB
testcase_44 AC 119 ms
90,816 KB
testcase_45 AC 181 ms
135,924 KB
testcase_46 AC 115 ms
84,440 KB
testcase_47 AC 1,222 ms
336,836 KB
testcase_48 AC 89 ms
76,316 KB
testcase_49 AC 91 ms
76,332 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
sys.setrecursionlimit(10**6)
input = sys.stdin.buffer.readline

n, m, k = map(int, input().split())
mod = 10**9+7
g = [[] for i in range(300)]
for i in range(m):
    p, q, c = map(int, input().split())
    p, q = p-1, q-1
    g[p].append((q, c))

dp = [[[0]*(k+1) for i in range(300)] for j in range(n)]
for i in range(300):
    dp[0][i][0] += 1

for i in range(n-1):
    for p in range(300):
        for q, c in g[p]:
            for j in range(k+1):
                if j+c <= k:
                    dp[i+1][q][j+c] += dp[i][p][j]
ans = 0
for i in range(300):
    ans += dp[n-1][i][k]
ans %= mod
print(ans)
0