結果

問題 No.1111 コード進行
ユーザー brthyyjpbrthyyjp
提出日時 2020-07-10 22:18:10
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,087 ms / 2,000 ms
コード長 619 bytes
コンパイル時間 193 ms
コンパイル使用メモリ 82,356 KB
実行使用メモリ 336,720 KB
最終ジャッジ日時 2024-04-19 17:31:01
合計ジャッジ時間 7,948 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
59,084 KB
testcase_01 AC 35 ms
52,684 KB
testcase_02 AC 34 ms
53,196 KB
testcase_03 AC 35 ms
54,292 KB
testcase_04 AC 32 ms
53,660 KB
testcase_05 AC 39 ms
62,824 KB
testcase_06 AC 45 ms
67,300 KB
testcase_07 AC 45 ms
67,100 KB
testcase_08 AC 45 ms
65,004 KB
testcase_09 AC 42 ms
64,172 KB
testcase_10 AC 45 ms
69,532 KB
testcase_11 AC 42 ms
63,972 KB
testcase_12 AC 45 ms
67,380 KB
testcase_13 AC 43 ms
65,532 KB
testcase_14 AC 51 ms
69,856 KB
testcase_15 AC 43 ms
63,712 KB
testcase_16 AC 48 ms
69,012 KB
testcase_17 AC 44 ms
68,660 KB
testcase_18 AC 40 ms
61,256 KB
testcase_19 AC 37 ms
60,596 KB
testcase_20 AC 39 ms
62,612 KB
testcase_21 AC 41 ms
61,548 KB
testcase_22 AC 45 ms
71,568 KB
testcase_23 AC 46 ms
65,764 KB
testcase_24 AC 44 ms
67,164 KB
testcase_25 AC 51 ms
72,456 KB
testcase_26 AC 46 ms
68,092 KB
testcase_27 AC 41 ms
62,860 KB
testcase_28 AC 144 ms
182,228 KB
testcase_29 AC 90 ms
113,476 KB
testcase_30 AC 249 ms
172,432 KB
testcase_31 AC 45 ms
73,748 KB
testcase_32 AC 394 ms
181,916 KB
testcase_33 AC 369 ms
147,232 KB
testcase_34 AC 111 ms
137,284 KB
testcase_35 AC 152 ms
180,244 KB
testcase_36 AC 248 ms
182,256 KB
testcase_37 AC 115 ms
105,036 KB
testcase_38 AC 213 ms
119,888 KB
testcase_39 AC 604 ms
234,176 KB
testcase_40 AC 564 ms
272,284 KB
testcase_41 AC 178 ms
182,564 KB
testcase_42 AC 144 ms
113,152 KB
testcase_43 AC 365 ms
180,084 KB
testcase_44 AC 75 ms
91,280 KB
testcase_45 AC 135 ms
136,668 KB
testcase_46 AC 74 ms
83,300 KB
testcase_47 AC 1,087 ms
336,720 KB
testcase_48 AC 49 ms
72,308 KB
testcase_49 AC 50 ms
71,528 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