結果

問題 No.1111 コード進行
ユーザー 👑 KazunKazun
提出日時 2020-07-10 23:24:13
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,085 ms / 2,000 ms
コード長 555 bytes
コンパイル時間 243 ms
コンパイル使用メモリ 82,768 KB
実行使用メモリ 296,576 KB
最終ジャッジ日時 2024-04-19 23:57:39
合計ジャッジ時間 9,202 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
59,392 KB
testcase_01 AC 44 ms
59,264 KB
testcase_02 AC 37 ms
52,224 KB
testcase_03 AC 37 ms
51,840 KB
testcase_04 AC 36 ms
52,608 KB
testcase_05 AC 57 ms
67,840 KB
testcase_06 AC 70 ms
73,984 KB
testcase_07 AC 72 ms
72,448 KB
testcase_08 AC 64 ms
68,992 KB
testcase_09 AC 66 ms
69,888 KB
testcase_10 AC 67 ms
74,368 KB
testcase_11 AC 61 ms
67,328 KB
testcase_12 AC 70 ms
72,704 KB
testcase_13 AC 66 ms
71,936 KB
testcase_14 AC 99 ms
82,816 KB
testcase_15 AC 63 ms
68,608 KB
testcase_16 AC 84 ms
80,512 KB
testcase_17 AC 65 ms
74,496 KB
testcase_18 AC 54 ms
65,536 KB
testcase_19 AC 47 ms
61,440 KB
testcase_20 AC 66 ms
73,216 KB
testcase_21 AC 51 ms
62,336 KB
testcase_22 AC 82 ms
85,248 KB
testcase_23 AC 67 ms
71,296 KB
testcase_24 AC 65 ms
71,168 KB
testcase_25 AC 94 ms
84,224 KB
testcase_26 AC 73 ms
73,600 KB
testcase_27 AC 60 ms
67,328 KB
testcase_28 AC 222 ms
181,760 KB
testcase_29 AC 154 ms
123,008 KB
testcase_30 AC 206 ms
148,224 KB
testcase_31 AC 85 ms
88,064 KB
testcase_32 AC 238 ms
143,704 KB
testcase_33 AC 263 ms
117,760 KB
testcase_34 AC 185 ms
155,776 KB
testcase_35 AC 219 ms
180,480 KB
testcase_36 AC 500 ms
184,576 KB
testcase_37 AC 198 ms
105,216 KB
testcase_38 AC 151 ms
96,896 KB
testcase_39 AC 380 ms
147,456 KB
testcase_40 AC 413 ms
176,768 KB
testcase_41 AC 271 ms
199,424 KB
testcase_42 AC 276 ms
127,360 KB
testcase_43 AC 272 ms
119,808 KB
testcase_44 AC 136 ms
100,480 KB
testcase_45 AC 232 ms
151,424 KB
testcase_46 AC 78 ms
83,140 KB
testcase_47 AC 1,085 ms
296,576 KB
testcase_48 AC 62 ms
71,168 KB
testcase_49 AC 64 ms
72,192 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

A=10**9+7
N,M,K=map(int,input().split())
S=300

E=[[] for _ in range(S+1)]
F=[[] for _ in range(S+1)]
for _ in range(M):
    p,q,c=map(int,input().split())
    E[p].append((q,c))
    F[q].append((p,c))

X=[[[0]*(K+1) for _ in range(S+1)] for _ in range(N)]

for f in range(1,S+1):
    X[0][f][0]=1

for n in range(1,N):
    for a in range(1,S+1):
        for k in range(K+1):
            for (q,c) in F[a]:
                if k>=c:
                    X[n][a][k]=(X[n][a][k]+X[n-1][q][k-c])%A

Y=0
for a in range(1,S+1):
    Y=(Y+X[-1][a][-1])%A
print(Y)
0