結果

問題 No.1111 コード進行
ユーザー convexineqconvexineq
提出日時 2021-05-11 02:12:49
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 569 bytes
コンパイル時間 225 ms
コンパイル使用メモリ 81,816 KB
実行使用メモリ 132,736 KB
最終ジャッジ日時 2023-10-21 06:55:34
合計ジャッジ時間 7,293 ms
ジャッジサーバーID
(参考情報)
judge12 / judge9
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,460 KB
testcase_01 AC 39 ms
53,460 KB
testcase_02 AC 39 ms
53,460 KB
testcase_03 WA -
testcase_04 AC 39 ms
53,460 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 50 ms
65,940 KB
testcase_08 AC 48 ms
61,824 KB
testcase_09 WA -
testcase_10 AC 50 ms
68,288 KB
testcase_11 AC 50 ms
64,088 KB
testcase_12 WA -
testcase_13 AC 47 ms
63,892 KB
testcase_14 WA -
testcase_15 AC 46 ms
61,824 KB
testcase_16 AC 50 ms
65,940 KB
testcase_17 AC 56 ms
70,520 KB
testcase_18 AC 45 ms
61,824 KB
testcase_19 AC 39 ms
53,460 KB
testcase_20 AC 51 ms
63,976 KB
testcase_21 AC 44 ms
59,388 KB
testcase_22 AC 56 ms
72,556 KB
testcase_23 AC 54 ms
66,184 KB
testcase_24 AC 55 ms
68,360 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 42 ms
55,508 KB
testcase_28 AC 115 ms
81,228 KB
testcase_29 AC 131 ms
78,312 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 AC 110 ms
79,600 KB
testcase_35 AC 141 ms
80,020 KB
testcase_36 AC 264 ms
86,920 KB
testcase_37 AC 125 ms
76,756 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 AC 168 ms
83,288 KB
testcase_42 AC 154 ms
78,028 KB
testcase_43 WA -
testcase_44 AC 88 ms
76,240 KB
testcase_45 AC 136 ms
79,340 KB
testcase_46 AC 67 ms
75,632 KB
testcase_47 AC 837 ms
132,736 KB
testcase_48 AC 63 ms
72,640 KB
testcase_49 AC 66 ms
73,004 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = 300
n,m,k = map(int,input().split())
g = [[] for _ in range(N)]
for _ in range(m):
    p,q,c = map(int,input().split())
    g[p-1].append((q-1,c))

MOD = 10**9+7
dp = [[0]*(k+1) for _ in range(N)]
for i in range(N):
    dp[i][0] = 1

for _ in range(n-1):
    ndp = [[0]*(k+1) for _ in range(N)]
    for i in range(n):
        for j,v in enumerate(dp[i]):
            for q,c in g[i]:
                if j+c > k: continue
                ndp[q][j+c] += v
                ndp[q][j+c] %= MOD
    dp = ndp

ans = 0
for i in range(n):
    ans += dp[i][-1]
print(ans%MOD)
0