結果

問題 No.1111 コード進行
ユーザー paruf4paruf4
提出日時 2020-07-11 17:39:44
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 529 bytes
コンパイル時間 226 ms
コンパイル使用メモリ 82,200 KB
実行使用メモリ 295,788 KB
最終ジャッジ日時 2024-04-21 08:05:35
合計ジャッジ時間 6,914 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
58,768 KB
testcase_01 AC 39 ms
52,344 KB
testcase_02 AC 43 ms
52,700 KB
testcase_03 AC 38 ms
53,512 KB
testcase_04 AC 38 ms
52,460 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 52 ms
64,776 KB
testcase_09 WA -
testcase_10 AC 52 ms
69,040 KB
testcase_11 AC 50 ms
64,616 KB
testcase_12 WA -
testcase_13 AC 51 ms
66,188 KB
testcase_14 WA -
testcase_15 AC 50 ms
63,996 KB
testcase_16 AC 57 ms
67,468 KB
testcase_17 AC 50 ms
68,660 KB
testcase_18 AC 45 ms
60,996 KB
testcase_19 AC 42 ms
59,720 KB
testcase_20 AC 48 ms
64,508 KB
testcase_21 AC 46 ms
61,036 KB
testcase_22 AC 56 ms
71,100 KB
testcase_23 AC 55 ms
65,444 KB
testcase_24 AC 51 ms
66,300 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 50 ms
64,492 KB
testcase_28 AC 167 ms
182,228 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 AC 124 ms
137,068 KB
testcase_35 AC 173 ms
180,044 KB
testcase_36 AC 335 ms
181,016 KB
testcase_37 AC 125 ms
89,940 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 AC 190 ms
182,364 KB
testcase_42 AC 180 ms
112,548 KB
testcase_43 WA -
testcase_44 WA -
testcase_45 AC 160 ms
136,556 KB
testcase_46 AC 58 ms
70,768 KB
testcase_47 AC 718 ms
295,788 KB
testcase_48 AC 60 ms
71,280 KB
testcase_49 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M,K=map(int,input().split())
P=[0]*301
Q=[0]*301
C=[0]*301
for i in range(M):
  p,q,c=map(int,input().split())
  P[i]=p-1
  Q[i]=q-1
  C[i]=c
  
mod=10**9+7
dp=[[[0]*(K+1) for _ in range(300)] for _ in range(N)]
for i in range(300):
  dp[0][i][0]=1

for i in range(N-1):
  for j in range(M):
    p=P[j]
    q=Q[j]
    c=C[j]
    for cost in range(K+1):
      if cost+c>K:continue
      dp[i+1][q][cost+c]+=dp[i][q][cost]
      dp[i+1][q][cost+c]%=mod
ans=0
for i in range(300):
  ans+=dp[N-1][i][K]
  ans%=mod
print(ans)






0