結果

問題 No.1111 コード進行
ユーザー tikitaka1201tikitaka1201
提出日時 2020-07-11 16:12:18
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 372 ms / 2,000 ms
コード長 586 bytes
コンパイル時間 268 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 91,776 KB
最終ジャッジ日時 2024-04-21 05:57:07
合計ジャッジ時間 6,573 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
52,352 KB
testcase_01 AC 40 ms
52,224 KB
testcase_02 AC 40 ms
52,096 KB
testcase_03 AC 41 ms
52,352 KB
testcase_04 AC 41 ms
52,224 KB
testcase_05 AC 49 ms
61,184 KB
testcase_06 AC 66 ms
68,736 KB
testcase_07 AC 69 ms
69,248 KB
testcase_08 AC 67 ms
67,328 KB
testcase_09 AC 62 ms
66,048 KB
testcase_10 AC 66 ms
70,400 KB
testcase_11 AC 62 ms
65,152 KB
testcase_12 AC 70 ms
69,376 KB
testcase_13 AC 62 ms
66,432 KB
testcase_14 AC 82 ms
74,240 KB
testcase_15 AC 60 ms
64,512 KB
testcase_16 AC 72 ms
70,784 KB
testcase_17 AC 63 ms
69,888 KB
testcase_18 AC 51 ms
60,928 KB
testcase_19 AC 48 ms
59,904 KB
testcase_20 AC 57 ms
63,872 KB
testcase_21 AC 51 ms
60,800 KB
testcase_22 AC 68 ms
72,832 KB
testcase_23 AC 71 ms
67,968 KB
testcase_24 AC 63 ms
67,584 KB
testcase_25 AC 86 ms
77,824 KB
testcase_26 AC 71 ms
70,528 KB
testcase_27 AC 57 ms
63,616 KB
testcase_28 AC 97 ms
83,072 KB
testcase_29 AC 87 ms
77,184 KB
testcase_30 AC 110 ms
80,640 KB
testcase_31 AC 73 ms
77,568 KB
testcase_32 AC 135 ms
78,080 KB
testcase_33 AC 139 ms
79,232 KB
testcase_34 AC 92 ms
80,896 KB
testcase_35 AC 94 ms
80,000 KB
testcase_36 AC 214 ms
82,688 KB
testcase_37 AC 115 ms
76,928 KB
testcase_38 AC 107 ms
76,800 KB
testcase_39 AC 168 ms
80,384 KB
testcase_40 AC 188 ms
81,920 KB
testcase_41 AC 114 ms
84,096 KB
testcase_42 AC 140 ms
77,824 KB
testcase_43 AC 142 ms
78,336 KB
testcase_44 AC 90 ms
76,928 KB
testcase_45 AC 112 ms
79,360 KB
testcase_46 AC 75 ms
74,240 KB
testcase_47 AC 372 ms
91,776 KB
testcase_48 AC 79 ms
73,600 KB
testcase_49 AC 74 ms
74,112 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod=10**9+7
n,m,k=map(int,input().split())
code=[[] for _ in range(301)]
for _ in range(m):
    p,q,c=map(int,input().split())
    code[p].append((q,c))
dp=[[0]*(k+1) for _ in range(301)]
for i in range(1,301):
    dp[i][0]+=1

for i in range(1,n):
    newdp=[[0]*(k+1) for _ in range(301)]
    for s in range(1,301):
        for g, cx in code[s]:
            for ct in range(k+1):
                if ct+cx<=k:
                    newdp[g][ct+cx]+=dp[s][ct]
                    newdp[g][ct+cx]%=mod
    dp=newdp+[]

ans=0
for i in range(1,301):
    ans+=dp[i][k]
    ans%=mod
print(ans)
0