結果

問題 No.1111 コード進行
ユーザー marroncastlemarroncastle
提出日時 2020-07-10 22:11:58
言語 PyPy3
(7.3.15)
結果
MLE  
(最新)
AC  
(最初)
実行時間 -
コード長 469 bytes
コンパイル時間 317 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 516,224 KB
最終ジャッジ日時 2024-04-19 17:24:06
合計ジャッジ時間 11,401 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 45 ms
61,824 KB
testcase_01 AC 43 ms
60,928 KB
testcase_02 AC 34 ms
54,016 KB
testcase_03 AC 36 ms
53,504 KB
testcase_04 AC 34 ms
53,504 KB
testcase_05 AC 49 ms
67,840 KB
testcase_06 AC 74 ms
86,272 KB
testcase_07 AC 82 ms
89,600 KB
testcase_08 AC 61 ms
74,692 KB
testcase_09 AC 56 ms
70,400 KB
testcase_10 AC 79 ms
91,476 KB
testcase_11 AC 53 ms
72,508 KB
testcase_12 AC 77 ms
86,400 KB
testcase_13 AC 54 ms
72,192 KB
testcase_14 AC 92 ms
90,632 KB
testcase_15 AC 65 ms
88,620 KB
testcase_16 AC 84 ms
87,552 KB
testcase_17 AC 78 ms
92,084 KB
testcase_18 AC 52 ms
72,576 KB
testcase_19 AC 43 ms
62,208 KB
testcase_20 AC 54 ms
68,992 KB
testcase_21 AC 44 ms
70,804 KB
testcase_22 AC 82 ms
92,032 KB
testcase_23 AC 70 ms
87,040 KB
testcase_24 AC 57 ms
74,240 KB
testcase_25 AC 107 ms
90,796 KB
testcase_26 AC 79 ms
90,964 KB
testcase_27 AC 51 ms
66,176 KB
testcase_28 AC 421 ms
316,928 KB
testcase_29 AC 263 ms
245,760 KB
testcase_30 AC 333 ms
228,620 KB
testcase_31 AC 82 ms
91,860 KB
testcase_32 AC 436 ms
305,460 KB
testcase_33 AC 277 ms
159,292 KB
testcase_34 AC 299 ms
251,648 KB
testcase_35 AC 464 ms
369,896 KB
testcase_36 AC 578 ms
316,948 KB
testcase_37 AC 259 ms
223,776 KB
testcase_38 AC 209 ms
181,996 KB
testcase_39 AC 432 ms
227,840 KB
testcase_40 AC 534 ms
315,008 KB
testcase_41 AC 499 ms
352,384 KB
testcase_42 AC 340 ms
250,624 KB
testcase_43 AC 300 ms
201,884 KB
testcase_44 AC 172 ms
159,944 KB
testcase_45 AC 375 ms
278,528 KB
testcase_46 AC 274 ms
296,616 KB
testcase_47 MLE -
testcase_48 AC 287 ms
296,600 KB
testcase_49 AC 287 ms
296,760 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M, K = map(int, input().split())
P = [0]*M
Q = [0]*M
C = [0]*M
for i in range(M):
    P[i],Q[i],C[i] = map(int, input().split())
dp = [[[0]*300 for _ in range(K+301)] for _ in range(N)]
mod = 10**9+7
for i in range(300):
    dp[0][0][i] = 1
for n in range(N-1):
    for k in range(K+1):
        for i in range(300):
            dp[n][k][i] %= mod
        for i in range(M):
            dp[n+1][k+C[i]][Q[i]-1] += dp[n][k][P[i]-1]
ans = sum(dp[-1][K])%mod
print(ans)
0