結果

問題 No.1111 コード進行
ユーザー tanon710tanon710
提出日時 2020-07-10 22:37:52
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 661 bytes
コンパイル時間 268 ms
コンパイル使用メモリ 82,500 KB
実行使用メモリ 297,300 KB
最終ジャッジ日時 2024-04-19 17:51:02
合計ジャッジ時間 6,422 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
58,632 KB
testcase_01 AC 35 ms
59,184 KB
testcase_02 AC 34 ms
53,872 KB
testcase_03 AC 34 ms
53,664 KB
testcase_04 AC 33 ms
53,496 KB
testcase_05 AC 38 ms
62,324 KB
testcase_06 AC 44 ms
67,072 KB
testcase_07 AC 48 ms
68,960 KB
testcase_08 AC 47 ms
66,612 KB
testcase_09 AC 45 ms
65,936 KB
testcase_10 AC 45 ms
70,848 KB
testcase_11 AC 44 ms
64,964 KB
testcase_12 AC 46 ms
67,400 KB
testcase_13 AC 40 ms
65,140 KB
testcase_14 AC 53 ms
72,500 KB
testcase_15 AC 42 ms
63,844 KB
testcase_16 AC 47 ms
68,292 KB
testcase_17 AC 41 ms
68,176 KB
testcase_18 AC 36 ms
60,900 KB
testcase_19 AC 33 ms
55,376 KB
testcase_20 AC 40 ms
62,768 KB
testcase_21 AC 36 ms
59,356 KB
testcase_22 AC 45 ms
71,000 KB
testcase_23 AC 43 ms
65,040 KB
testcase_24 AC 41 ms
65,976 KB
testcase_25 AC 55 ms
74,264 KB
testcase_26 WA -
testcase_27 AC 44 ms
64,024 KB
testcase_28 AC 149 ms
182,388 KB
testcase_29 AC 94 ms
113,496 KB
testcase_30 WA -
testcase_31 AC 45 ms
73,796 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 AC 125 ms
156,248 KB
testcase_35 AC 150 ms
181,048 KB
testcase_36 AC 318 ms
181,780 KB
testcase_37 AC 115 ms
90,488 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 AC 173 ms
182,420 KB
testcase_42 AC 167 ms
113,116 KB
testcase_43 WA -
testcase_44 AC 80 ms
91,168 KB
testcase_45 AC 143 ms
136,596 KB
testcase_46 WA -
testcase_47 AC 698 ms
297,300 KB
testcase_48 AC 52 ms
72,092 KB
testcase_49 AC 53 ms
72,108 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3

import sys
input=sys.stdin.readline

mod=10**9+7
N,M,K=map(int,input().split())
edges=[[] for _ in range(301)]
s=set()
for _ in range(M):
    p,q,c=map(int,input().split())
    edges[p].append((q,c))
    s.add(p)
dp=[[[0]*(K+1) for _ in range(301)] for _ in range(N+1)]
for i in range(301):
    if i not in s:
        dp[1][i][0]=0
    else:
        dp[1][i][0]=1
for i in range(1,N):
    for j in s:
        for q,c in edges[j]:
            for k in range(K-c,-1,-1):
                dp[i+1][q][k+c]+=dp[i][j][k]
                dp[i+1][q][k+c]%=mod
ans=0
for i in range(301):
    ans+=dp[N][i][K]
print(ans)
0