結果

問題 No.1111 コード進行
ユーザー ttrttr
提出日時 2020-08-05 20:09:37
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 595 bytes
コンパイル時間 99 ms
コンパイル使用メモリ 11,788 KB
実行使用メモリ 16,452 KB
最終ジャッジ日時 2023-10-17 12:20:48
合計ジャッジ時間 11,315 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
10,196 KB
testcase_01 AC 31 ms
10,164 KB
testcase_02 AC 30 ms
10,124 KB
testcase_03 AC 30 ms
10,124 KB
testcase_04 AC 30 ms
10,124 KB
testcase_05 AC 34 ms
11,976 KB
testcase_06 AC 94 ms
11,556 KB
testcase_07 AC 95 ms
10,920 KB
testcase_08 AC 50 ms
10,464 KB
testcase_09 AC 69 ms
11,712 KB
testcase_10 AC 73 ms
10,920 KB
testcase_11 AC 42 ms
10,516 KB
testcase_12 AC 139 ms
11,564 KB
testcase_13 AC 48 ms
11,388 KB
testcase_14 AC 256 ms
11,776 KB
testcase_15 AC 35 ms
10,272 KB
testcase_16 AC 160 ms
11,736 KB
testcase_17 AC 46 ms
11,200 KB
testcase_18 AC 31 ms
10,456 KB
testcase_19 AC 31 ms
10,656 KB
testcase_20 AC 38 ms
11,448 KB
testcase_21 AC 30 ms
10,168 KB
testcase_22 AC 68 ms
11,608 KB
testcase_23 AC 56 ms
10,892 KB
testcase_24 AC 55 ms
11,336 KB
testcase_25 AC 297 ms
11,448 KB
testcase_26 AC 222 ms
11,124 KB
testcase_27 AC 43 ms
10,920 KB
testcase_28 AC 215 ms
11,892 KB
testcase_29 AC 322 ms
10,892 KB
testcase_30 AC 1,403 ms
11,964 KB
testcase_31 AC 69 ms
11,500 KB
testcase_32 TLE -
testcase_33 TLE -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
testcase_46 -- -
testcase_47 -- -
testcase_48 -- -
testcase_49 -- -
権限があれば一括ダウンロードができます

ソースコード

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:
    if l[2] > K:
        continue
    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-1)%2][i][K]
    ans %= mod
print(ans)
0