結果

問題 No.1111 コード進行
ユーザー tanon710tanon710
提出日時 2020-07-10 22:34:08
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 610 bytes
コンパイル時間 267 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 338,432 KB
最終ジャッジ日時 2024-04-19 17:47:45
合計ジャッジ時間 8,085 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
59,548 KB
testcase_01 AC 36 ms
58,696 KB
testcase_02 AC 33 ms
53,596 KB
testcase_03 AC 37 ms
54,504 KB
testcase_04 AC 35 ms
53,408 KB
testcase_05 AC 37 ms
62,312 KB
testcase_06 AC 43 ms
66,236 KB
testcase_07 AC 49 ms
69,268 KB
testcase_08 AC 44 ms
64,128 KB
testcase_09 AC 44 ms
64,640 KB
testcase_10 AC 46 ms
68,864 KB
testcase_11 AC 42 ms
62,976 KB
testcase_12 AC 45 ms
66,456 KB
testcase_13 AC 40 ms
64,384 KB
testcase_14 AC 50 ms
70,784 KB
testcase_15 AC 43 ms
62,720 KB
testcase_16 AC 46 ms
67,584 KB
testcase_17 AC 42 ms
67,072 KB
testcase_18 AC 35 ms
59,776 KB
testcase_19 AC 34 ms
53,888 KB
testcase_20 AC 39 ms
61,696 KB
testcase_21 AC 37 ms
59,136 KB
testcase_22 AC 43 ms
70,016 KB
testcase_23 AC 43 ms
64,512 KB
testcase_24 AC 41 ms
65,024 KB
testcase_25 AC 54 ms
73,344 KB
testcase_26 WA -
testcase_27 AC 41 ms
62,848 KB
testcase_28 AC 152 ms
182,164 KB
testcase_29 AC 94 ms
113,368 KB
testcase_30 WA -
testcase_31 AC 46 ms
73,716 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 AC 113 ms
137,224 KB
testcase_35 AC 158 ms
180,900 KB
testcase_36 AC 264 ms
182,052 KB
testcase_37 AC 102 ms
90,528 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 AC 167 ms
182,596 KB
testcase_42 AC 147 ms
113,128 KB
testcase_43 WA -
testcase_44 AC 75 ms
90,960 KB
testcase_45 AC 142 ms
136,508 KB
testcase_46 WA -
testcase_47 AC 1,123 ms
338,432 KB
testcase_48 AC 52 ms
71,352 KB
testcase_49 AC 53 ms
71,552 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3

import sys
input=sys.stdin.readline

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]
ans=0
for i in range(301):
    ans+=dp[N][i][K]
print(ans)
0