結果

問題 No.1111 コード進行
ユーザー ttrttr
提出日時 2020-08-05 20:01:23
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 561 bytes
コンパイル時間 837 ms
コンパイル使用メモリ 81,596 KB
実行使用メモリ 97,148 KB
最終ジャッジ日時 2023-10-17 12:06:28
合計ジャッジ時間 7,153 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,344 KB
testcase_01 AC 37 ms
53,344 KB
testcase_02 AC 36 ms
53,344 KB
testcase_03 AC 37 ms
53,344 KB
testcase_04 AC 37 ms
53,344 KB
testcase_05 AC 38 ms
55,392 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 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 AC 62 ms
70,480 KB
testcase_27 AC 48 ms
61,804 KB
testcase_28 AC 85 ms
84,376 KB
testcase_29 AC 74 ms
76,780 KB
testcase_30 AC 110 ms
80,728 KB
testcase_31 AC 61 ms
76,588 KB
testcase_32 AC 157 ms
77,940 KB
testcase_33 AC 158 ms
78,492 KB
testcase_34 AC 78 ms
81,508 KB
testcase_35 AC 85 ms
81,048 KB
testcase_36 AC 273 ms
84,196 KB
testcase_37 AC 118 ms
76,356 KB
testcase_38 AC 108 ms
75,932 KB
testcase_39 AC 212 ms
80,820 KB
testcase_40 AC 225 ms
82,924 KB
testcase_41 AC 105 ms
84,020 KB
testcase_42 AC 154 ms
76,908 KB
testcase_43 AC 158 ms
77,680 KB
testcase_44 AC 79 ms
76,032 KB
testcase_45 AC 112 ms
79,192 KB
testcase_46 AC 58 ms
72,444 KB
testcase_47 AC 603 ms
97,148 KB
testcase_48 AC 58 ms
72,444 KB
testcase_49 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M,K = map(int, input().split())
L = [[int(l) for l in input().split()] for _ in range(M)]
mod = 10**9+7

num = 301
dp = [[[0]*(K+1) for _ in range(num)] for _ in range(2)]

for l in L:
    dp[1][l[1]][l[2]] += 1
for i in range(N-2):
    dp[i%2] = [[0]*(K+1) for _ in range(num)]
    for l in L:
        for k in range(K+1):
            if k+l[2] > K:
                continue
            dp[i%2][l[1]][k+l[2]] += dp[(i+1)%2][l[0]][k]
            dp[i%2][l[1]][k+l[2]] %= mod

ans = 0
for i in range(num):
    ans += dp[(N-3)%2][i][K]
    ans %= mod
print(ans)
0