結果

問題 No.1111 コード進行
ユーザー hir355hir355
提出日時 2020-07-10 21:42:09
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,062 ms / 2,000 ms
コード長 502 bytes
コンパイル時間 295 ms
コンパイル使用メモリ 82,792 KB
実行使用メモリ 322,148 KB
最終ジャッジ日時 2024-04-19 16:27:55
合計ジャッジ時間 10,731 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
57,856 KB
testcase_01 AC 38 ms
57,856 KB
testcase_02 AC 35 ms
51,968 KB
testcase_03 AC 35 ms
52,352 KB
testcase_04 AC 35 ms
52,352 KB
testcase_05 AC 44 ms
62,592 KB
testcase_06 AC 56 ms
69,248 KB
testcase_07 AC 53 ms
68,096 KB
testcase_08 AC 51 ms
64,908 KB
testcase_09 AC 51 ms
65,280 KB
testcase_10 AC 52 ms
69,504 KB
testcase_11 AC 48 ms
63,488 KB
testcase_12 AC 59 ms
69,120 KB
testcase_13 AC 53 ms
66,816 KB
testcase_14 AC 66 ms
71,936 KB
testcase_15 AC 47 ms
63,488 KB
testcase_16 AC 73 ms
80,812 KB
testcase_17 AC 51 ms
70,016 KB
testcase_18 AC 43 ms
62,592 KB
testcase_19 AC 41 ms
60,928 KB
testcase_20 AC 47 ms
63,872 KB
testcase_21 AC 43 ms
60,160 KB
testcase_22 AC 58 ms
73,344 KB
testcase_23 AC 56 ms
69,376 KB
testcase_24 AC 49 ms
66,688 KB
testcase_25 AC 75 ms
74,956 KB
testcase_26 AC 58 ms
69,376 KB
testcase_27 AC 49 ms
63,616 KB
testcase_28 AC 197 ms
182,912 KB
testcase_29 AC 124 ms
114,268 KB
testcase_30 AC 544 ms
220,392 KB
testcase_31 AC 67 ms
87,880 KB
testcase_32 AC 584 ms
232,260 KB
testcase_33 AC 493 ms
169,268 KB
testcase_34 AC 154 ms
154,368 KB
testcase_35 AC 191 ms
159,700 KB
testcase_36 AC 457 ms
184,088 KB
testcase_37 AC 148 ms
101,800 KB
testcase_38 AC 277 ms
122,496 KB
testcase_39 AC 1,001 ms
271,360 KB
testcase_40 AC 1,062 ms
322,148 KB
testcase_41 AC 272 ms
197,132 KB
testcase_42 AC 258 ms
124,664 KB
testcase_43 AC 595 ms
192,256 KB
testcase_44 AC 100 ms
91,432 KB
testcase_45 AC 228 ms
148,756 KB
testcase_46 AC 66 ms
77,568 KB
testcase_47 AC 954 ms
297,984 KB
testcase_48 AC 48 ms
63,360 KB
testcase_49 AC 50 ms
64,000 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 10 ** 9 + 7
n, m, k = map(int, input().split())
t = [[] for _ in range(300)]
for _ in range(m):
    p, q, c = map(int, input().split())
    t[p - 1].append((q - 1, c))
dp = [[[0] * (300) for _ in range(k + 1)] for _ in range(n)]
for i in range(300):
    dp[0][0][i] = 1
for i in range(n - 1):
    for j in range(k + 1):
        for a in range(300):
            for b, c in t[a]:
                if j + c <= k:
                    dp[i + 1][j + c][b] += dp[i][j][a]
print(sum(dp[n - 1][k]) % MOD)
0