結果

問題 No.1111 コード進行
ユーザー titiatitia
提出日時 2020-07-11 02:20:02
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 542 bytes
コンパイル時間 316 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 17,952 KB
最終ジャッジ日時 2024-04-20 05:13:14
合計ジャッジ時間 13,661 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
17,952 KB
testcase_01 AC 29 ms
10,880 KB
testcase_02 AC 28 ms
10,752 KB
testcase_03 AC 27 ms
10,752 KB
testcase_04 AC 27 ms
10,752 KB
testcase_05 AC 30 ms
11,904 KB
testcase_06 AC 91 ms
11,720 KB
testcase_07 AC 135 ms
11,264 KB
testcase_08 AC 153 ms
11,008 KB
testcase_09 AC 65 ms
11,936 KB
testcase_10 AC 80 ms
11,264 KB
testcase_11 AC 84 ms
11,008 KB
testcase_12 AC 131 ms
11,732 KB
testcase_13 AC 52 ms
11,520 KB
testcase_14 AC 220 ms
11,776 KB
testcase_15 AC 80 ms
10,880 KB
testcase_16 AC 154 ms
11,872 KB
testcase_17 AC 48 ms
11,520 KB
testcase_18 AC 36 ms
11,008 KB
testcase_19 AC 30 ms
11,520 KB
testcase_20 AC 36 ms
11,552 KB
testcase_21 AC 66 ms
10,752 KB
testcase_22 AC 62 ms
11,520 KB
testcase_23 AC 76 ms
11,264 KB
testcase_24 AC 54 ms
11,520 KB
testcase_25 AC 298 ms
11,528 KB
testcase_26 AC 215 ms
11,392 KB
testcase_27 AC 48 ms
11,392 KB
testcase_28 AC 160 ms
11,652 KB
testcase_29 AC 281 ms
11,264 KB
testcase_30 AC 935 ms
12,040 KB
testcase_31 AC 56 ms
11,592 KB
testcase_32 TLE -
testcase_33 TLE -
testcase_34 AC 130 ms
11,648 KB
testcase_35 AC 184 ms
11,520 KB
testcase_36 TLE -
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 #

import sys
input = sys.stdin.readline

mod=10**9+7

N,M,K=map(int,input().split())

E=[tuple(map(int,input().split())) for i in range(M)]

DP=dict()
DP=[[0]*(K+1) for i in range(301)]
for i in range(1,301):
    DP[i][0]=1

for i in range(N-1):
    NDP=[[0]*(K+1) for i in range(301)]

    for fr,to,cost in E:
        for j in range(301):
            if j+cost<=K:
                NDP[to][j+cost]+=DP[fr][j]
                NDP[to][j+cost]%=mod

    DP=NDP
                    
ANS=0
for i in range(301):
    ANS=(ANS+DP[i][K])%mod
print(ANS)
0