結果

問題 No.1111 コード進行
ユーザー convexineqconvexineq
提出日時 2021-05-11 02:15:37
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 599 bytes
コンパイル時間 231 ms
コンパイル使用メモリ 81,780 KB
実行使用メモリ 90,420 KB
最終ジャッジ日時 2023-10-21 06:58:34
合計ジャッジ時間 5,810 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 48 ms
59,768 KB
testcase_01 AC 46 ms
59,776 KB
testcase_02 AC 41 ms
53,512 KB
testcase_03 AC 41 ms
53,512 KB
testcase_04 AC 40 ms
53,512 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 63 ms
68,492 KB
testcase_08 AC 53 ms
64,216 KB
testcase_09 WA -
testcase_10 AC 55 ms
68,312 KB
testcase_11 AC 51 ms
64,216 KB
testcase_12 WA -
testcase_13 AC 52 ms
64,216 KB
testcase_14 WA -
testcase_15 AC 50 ms
62,168 KB
testcase_16 AC 61 ms
70,540 KB
testcase_17 AC 53 ms
68,312 KB
testcase_18 AC 48 ms
62,168 KB
testcase_19 AC 44 ms
59,768 KB
testcase_20 AC 49 ms
63,888 KB
testcase_21 AC 47 ms
61,956 KB
testcase_22 AC 55 ms
70,364 KB
testcase_23 AC 52 ms
64,220 KB
testcase_24 AC 58 ms
66,364 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 50 ms
61,844 KB
testcase_28 AC 113 ms
81,596 KB
testcase_29 AC 87 ms
76,784 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 AC 105 ms
79,784 KB
testcase_35 AC 107 ms
79,520 KB
testcase_36 AC 121 ms
81,892 KB
testcase_37 AC 87 ms
76,456 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 AC 118 ms
81,344 KB
testcase_42 AC 91 ms
76,868 KB
testcase_43 WA -
testcase_44 AC 67 ms
76,112 KB
testcase_45 AC 92 ms
77,980 KB
testcase_46 AC 65 ms
72,632 KB
testcase_47 AC 175 ms
90,420 KB
testcase_48 AC 65 ms
72,636 KB
testcase_49 AC 61 ms
72,516 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]):
            if v==0: continue
            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