結果

問題 No.1111 コード進行
ユーザー tanon710tanon710
提出日時 2020-07-10 22:11:58
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 594 bytes
コンパイル時間 296 ms
コンパイル使用メモリ 87,028 KB
実行使用メモリ 338,256 KB
最終ジャッジ日時 2023-08-01 18:11:55
合計ジャッジ時間 11,274 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
75,520 KB
testcase_01 AC 74 ms
71,320 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 73 ms
71,204 KB
testcase_05 AC 75 ms
71,236 KB
testcase_06 AC 83 ms
76,076 KB
testcase_07 AC 87 ms
76,496 KB
testcase_08 AC 85 ms
76,556 KB
testcase_09 AC 84 ms
76,536 KB
testcase_10 AC 84 ms
76,448 KB
testcase_11 AC 84 ms
76,476 KB
testcase_12 AC 86 ms
76,432 KB
testcase_13 AC 80 ms
75,880 KB
testcase_14 AC 90 ms
76,548 KB
testcase_15 AC 81 ms
76,212 KB
testcase_16 AC 87 ms
76,548 KB
testcase_17 AC 79 ms
76,208 KB
testcase_18 AC 75 ms
75,560 KB
testcase_19 AC 74 ms
70,980 KB
testcase_20 AC 83 ms
75,980 KB
testcase_21 AC 79 ms
75,256 KB
testcase_22 AC 80 ms
76,100 KB
testcase_23 AC 84 ms
76,460 KB
testcase_24 AC 84 ms
76,600 KB
testcase_25 AC 105 ms
85,412 KB
testcase_26 WA -
testcase_27 AC 84 ms
76,116 KB
testcase_28 AC 195 ms
181,524 KB
testcase_29 AC 133 ms
112,672 KB
testcase_30 WA -
testcase_31 AC 85 ms
76,448 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 AC 176 ms
156,704 KB
testcase_35 AC 195 ms
180,900 KB
testcase_36 AC 272 ms
180,840 KB
testcase_37 AC 129 ms
89,888 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 AC 203 ms
181,568 KB
testcase_42 AC 169 ms
112,656 KB
testcase_43 WA -
testcase_44 AC 111 ms
90,472 KB
testcase_45 AC 164 ms
135,892 KB
testcase_46 WA -
testcase_47 AC 1,232 ms
338,256 KB
testcase_48 AC 92 ms
76,612 KB
testcase_49 AC 92 ms
76,416 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3

import sys
input=sys.stdin.readline

N,M,K=map(int,input().split())
edges=[[] for _ in range(301)]
s1=set()
s2=set()
for _ in range(M):
    p,q,c=map(int,input().split())
    edges[p].append((q,c))
    s1.add(p)
    s2.add(q)
s=list(s1&s2)
dp=[[[0]*(K+1) for _ in range(301)] for _ in range(N)]
for i in range(301):
    dp[0][i][0]=1
for i in range(N-1):
    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-1][i][K]
print(ans)
0