結果

問題 No.1111 コード進行
ユーザー O2MTO2MT
提出日時 2021-06-09 16:11:09
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 497 bytes
コンパイル時間 488 ms
コンパイル使用メモリ 86,908 KB
実行使用メモリ 298,160 KB
最終ジャッジ日時 2023-08-18 21:00:42
合計ジャッジ時間 10,646 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
76,184 KB
testcase_01 AC 78 ms
76,284 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 63 ms
71,300 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 74 ms
76,380 KB
testcase_08 AC 73 ms
76,332 KB
testcase_09 WA -
testcase_10 AC 76 ms
76,344 KB
testcase_11 AC 71 ms
76,432 KB
testcase_12 WA -
testcase_13 AC 76 ms
76,572 KB
testcase_14 WA -
testcase_15 AC 72 ms
75,964 KB
testcase_16 AC 81 ms
76,488 KB
testcase_17 AC 76 ms
76,564 KB
testcase_18 AC 73 ms
76,372 KB
testcase_19 AC 72 ms
75,464 KB
testcase_20 AC 72 ms
76,284 KB
testcase_21 AC 69 ms
76,260 KB
testcase_22 AC 93 ms
86,644 KB
testcase_23 AC 73 ms
76,284 KB
testcase_24 AC 75 ms
76,544 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 225 ms
176,824 KB
testcase_29 AC 156 ms
124,956 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 AC 195 ms
156,572 KB
testcase_35 AC 241 ms
181,928 KB
testcase_36 AC 495 ms
175,656 KB
testcase_37 AC 166 ms
106,076 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 AC 239 ms
193,800 KB
testcase_42 AC 316 ms
127,544 KB
testcase_43 WA -
testcase_44 AC 137 ms
97,792 KB
testcase_45 AC 246 ms
151,764 KB
testcase_46 WA -
testcase_47 AC 933 ms
298,160 KB
testcase_48 AC 101 ms
84,060 KB
testcase_49 AC 96 ms
83,536 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M,K = map(int,input().split())
l = []
MOD = 10**9+7
NUM = 301
for _ in range(M):
  p,q,c = map(int,input().split())
  l.append((p,q,c))
dp = [[[0 for _ in range(K+1)] for _ in range(NUM)] for _ in range(N+1)]
for i in range(NUM):
  dp[0][i][0] = 1
for i in range(N):
  for k in range(K+1):
    for j in range(M):
      p,q,c = l[j]
      if k+c > K:
        break
      dp[i+1][q][k+c] += dp[i][p][k]
      dp[i+1][q][k+c] %= MOD

ans = 0
for i in range(NUM):
  ans += dp[N][i][K]
print(ans%MOD)
0