結果

問題 No.1111 コード進行
ユーザー tanon710tanon710
提出日時 2020-07-10 22:28:40
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 816 bytes
コンパイル時間 361 ms
コンパイル使用メモリ 82,252 KB
実行使用メモリ 338,388 KB
最終ジャッジ日時 2024-04-19 17:38:29
合計ジャッジ時間 8,082 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
59,876 KB
testcase_01 AC 35 ms
58,100 KB
testcase_02 AC 34 ms
53,144 KB
testcase_03 AC 34 ms
52,612 KB
testcase_04 AC 33 ms
53,012 KB
testcase_05 AC 36 ms
62,088 KB
testcase_06 AC 44 ms
67,280 KB
testcase_07 AC 48 ms
69,372 KB
testcase_08 AC 44 ms
64,716 KB
testcase_09 AC 44 ms
66,204 KB
testcase_10 AC 44 ms
69,372 KB
testcase_11 AC 41 ms
63,912 KB
testcase_12 AC 50 ms
68,912 KB
testcase_13 AC 41 ms
65,436 KB
testcase_14 AC 53 ms
72,340 KB
testcase_15 AC 38 ms
61,676 KB
testcase_16 AC 48 ms
68,528 KB
testcase_17 AC 41 ms
67,716 KB
testcase_18 AC 37 ms
59,844 KB
testcase_19 AC 33 ms
55,252 KB
testcase_20 AC 40 ms
63,476 KB
testcase_21 AC 36 ms
59,596 KB
testcase_22 AC 45 ms
70,628 KB
testcase_23 AC 44 ms
65,640 KB
testcase_24 AC 42 ms
65,708 KB
testcase_25 AC 54 ms
74,528 KB
testcase_26 WA -
testcase_27 AC 43 ms
64,184 KB
testcase_28 AC 148 ms
182,088 KB
testcase_29 AC 91 ms
113,432 KB
testcase_30 WA -
testcase_31 AC 45 ms
73,744 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 AC 112 ms
136,916 KB
testcase_35 AC 148 ms
180,752 KB
testcase_36 AC 217 ms
181,716 KB
testcase_37 AC 94 ms
90,540 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 AC 154 ms
182,560 KB
testcase_42 AC 127 ms
113,096 KB
testcase_43 WA -
testcase_44 AC 74 ms
91,128 KB
testcase_45 AC 118 ms
136,516 KB
testcase_46 WA -
testcase_47 AC 1,067 ms
338,388 KB
testcase_48 AC 50 ms
71,904 KB
testcase_49 AC 50 ms
73,228 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+1)]
for i in range(301):
    if i not in s1:
        dp[1][i][0]=0
    else:
        dp[1][i][0]=1
for i in range(301):
    if i not in s1:
        continue
    for q,c in edges[i]:
        for k in range(K-c,-1,-1):
            dp[2][q][k+c]+=dp[1][i][k]
for i in range(2,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