結果

問題 No.1111 コード進行
ユーザー tanon710tanon710
提出日時 2020-07-10 22:00:59
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 460 bytes
コンパイル時間 1,749 ms
コンパイル使用メモリ 86,596 KB
実行使用メモリ 338,064 KB
最終ジャッジ日時 2023-08-01 17:56:43
合計ジャッジ時間 12,684 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
75,296 KB
testcase_01 AC 73 ms
71,324 KB
testcase_02 AC 73 ms
71,420 KB
testcase_03 AC 73 ms
71,112 KB
testcase_04 AC 73 ms
71,276 KB
testcase_05 AC 73 ms
71,420 KB
testcase_06 AC 84 ms
76,460 KB
testcase_07 AC 85 ms
76,396 KB
testcase_08 AC 85 ms
76,340 KB
testcase_09 AC 80 ms
76,644 KB
testcase_10 AC 82 ms
76,472 KB
testcase_11 AC 81 ms
76,308 KB
testcase_12 AC 85 ms
76,344 KB
testcase_13 AC 81 ms
76,508 KB
testcase_14 AC 90 ms
76,356 KB
testcase_15 AC 82 ms
76,172 KB
testcase_16 AC 87 ms
76,344 KB
testcase_17 AC 85 ms
76,144 KB
testcase_18 AC 79 ms
75,396 KB
testcase_19 AC 75 ms
71,208 KB
testcase_20 AC 81 ms
75,928 KB
testcase_21 AC 79 ms
75,432 KB
testcase_22 AC 84 ms
76,232 KB
testcase_23 AC 83 ms
76,524 KB
testcase_24 AC 81 ms
76,376 KB
testcase_25 AC 90 ms
76,540 KB
testcase_26 WA -
testcase_27 AC 79 ms
76,148 KB
testcase_28 AC 195 ms
181,836 KB
testcase_29 AC 134 ms
112,848 KB
testcase_30 WA -
testcase_31 AC 83 ms
76,348 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 AC 173 ms
156,864 KB
testcase_35 AC 194 ms
181,064 KB
testcase_36 AC 311 ms
181,100 KB
testcase_37 AC 138 ms
90,104 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 AC 213 ms
181,764 KB
testcase_42 AC 190 ms
112,668 KB
testcase_43 WA -
testcase_44 AC 114 ms
90,808 KB
testcase_45 AC 179 ms
135,780 KB
testcase_46 WA -
testcase_47 AC 1,297 ms
338,064 KB
testcase_48 AC 92 ms
76,572 KB
testcase_49 AC 89 ms
76,352 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3

import sys
input=sys.stdin.readline

N,M,K=map(int,input().split())
arr=[list(map(int,input().split())) for _ in range(M)]
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 range(M):
        p,q,c=arr[j]
        for k in range(K-c,-1,-1):
            dp[i+1][q][k+c]+=dp[i][p][k]
ans=0
for i in range(301):
    ans+=dp[N-1][i][K]
print(ans)
0