結果

問題 No.1111 コード進行
ユーザー roarisroaris
提出日時 2020-07-11 14:41:50
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 901 ms / 2,000 ms
コード長 488 bytes
コンパイル時間 515 ms
コンパイル使用メモリ 87,332 KB
実行使用メモリ 296,604 KB
最終ジャッジ日時 2023-08-03 04:02:16
合計ジャッジ時間 10,382 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
75,560 KB
testcase_01 AC 68 ms
70,992 KB
testcase_02 AC 67 ms
70,776 KB
testcase_03 AC 71 ms
71,160 KB
testcase_04 AC 68 ms
70,928 KB
testcase_05 AC 73 ms
75,352 KB
testcase_06 AC 82 ms
76,188 KB
testcase_07 AC 83 ms
76,196 KB
testcase_08 AC 79 ms
76,420 KB
testcase_09 AC 81 ms
76,136 KB
testcase_10 AC 79 ms
76,044 KB
testcase_11 AC 74 ms
76,088 KB
testcase_12 AC 85 ms
76,200 KB
testcase_13 AC 79 ms
76,096 KB
testcase_14 AC 93 ms
76,096 KB
testcase_15 AC 74 ms
76,288 KB
testcase_16 AC 88 ms
76,168 KB
testcase_17 AC 74 ms
75,980 KB
testcase_18 AC 70 ms
75,860 KB
testcase_19 AC 71 ms
75,520 KB
testcase_20 AC 79 ms
76,168 KB
testcase_21 AC 72 ms
76,024 KB
testcase_22 AC 81 ms
75,900 KB
testcase_23 AC 81 ms
76,140 KB
testcase_24 AC 77 ms
76,276 KB
testcase_25 AC 104 ms
76,484 KB
testcase_26 AC 86 ms
75,928 KB
testcase_27 AC 78 ms
76,040 KB
testcase_28 AC 193 ms
181,332 KB
testcase_29 AC 132 ms
112,532 KB
testcase_30 AC 184 ms
135,888 KB
testcase_31 AC 96 ms
88,548 KB
testcase_32 AC 225 ms
135,052 KB
testcase_33 AC 230 ms
112,232 KB
testcase_34 AC 165 ms
156,144 KB
testcase_35 AC 197 ms
180,968 KB
testcase_36 AC 536 ms
180,420 KB
testcase_37 AC 192 ms
89,464 KB
testcase_38 AC 161 ms
89,408 KB
testcase_39 AC 317 ms
135,400 KB
testcase_40 AC 396 ms
158,376 KB
testcase_41 AC 220 ms
181,712 KB
testcase_42 AC 270 ms
112,040 KB
testcase_43 AC 257 ms
112,440 KB
testcase_44 AC 118 ms
90,360 KB
testcase_45 AC 217 ms
135,756 KB
testcase_46 AC 82 ms
76,620 KB
testcase_47 AC 901 ms
296,604 KB
testcase_48 AC 105 ms
76,324 KB
testcase_49 AC 82 ms
76,528 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

N, M, K = map(int, input().split())
PQR = [tuple(map(int, input().split())) for _ in range(M)]
dp = [[[0]*(K+1) for _ in range(300)] for _ in range(N)]

for i in range(300):
    dp[0][i][0] = 1

MOD = 10**9+7

for i in range(N-1):
    for j in range(K+1):
        for P, Q, R in PQR:
            if j+R<=K:
                dp[i+1][Q-1][j+R] += dp[i][P-1][j]
                dp[i+1][Q-1][j+R] %= MOD

print(sum(dp[N-1][i][K] for i in range(300))%MOD)
0