結果

問題 No.1111 コード進行
ユーザー takakintakakin
提出日時 2020-07-10 21:47:48
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 494 bytes
コンパイル時間 228 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 121,088 KB
最終ジャッジ日時 2024-04-19 16:43:01
合計ジャッジ時間 11,898 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
16,256 KB
testcase_01 AC 28 ms
10,880 KB
testcase_02 AC 28 ms
10,880 KB
testcase_03 AC 27 ms
10,752 KB
testcase_04 AC 26 ms
10,880 KB
testcase_05 AC 36 ms
13,824 KB
testcase_06 AC 76 ms
15,616 KB
testcase_07 AC 63 ms
15,232 KB
testcase_08 AC 36 ms
12,288 KB
testcase_09 AC 50 ms
13,696 KB
testcase_10 AC 62 ms
17,536 KB
testcase_11 AC 33 ms
12,160 KB
testcase_12 AC 89 ms
15,616 KB
testcase_13 AC 45 ms
14,336 KB
testcase_14 AC 153 ms
18,048 KB
testcase_15 AC 32 ms
11,776 KB
testcase_16 AC 98 ms
16,256 KB
testcase_17 AC 54 ms
17,920 KB
testcase_18 AC 34 ms
12,160 KB
testcase_19 AC 30 ms
11,904 KB
testcase_20 AC 36 ms
13,184 KB
testcase_21 AC 30 ms
11,136 KB
testcase_22 AC 71 ms
20,096 KB
testcase_23 AC 45 ms
14,080 KB
testcase_24 AC 49 ms
14,976 KB
testcase_25 AC 158 ms
19,328 KB
testcase_26 WA -
testcase_27 AC 37 ms
12,288 KB
testcase_28 AC 509 ms
121,088 KB
testcase_29 AC 372 ms
58,496 KB
testcase_30 WA -
testcase_31 AC 84 ms
23,424 KB
testcase_32 TLE -
testcase_33 TLE -
testcase_34 AC 388 ms
90,752 KB
testcase_35 AC 518 ms
115,200 KB
testcase_36 TLE -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
testcase_46 -- -
testcase_47 -- -
testcase_48 -- -
testcase_49 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=lambda: sys.stdin.readline().rstrip()
n,m,k=map(int,input().split())
mod=10**9+7
PQ=[[int(i) for i in input().split()] for _ in range(m)]

DP=[[[0]*(k+1) for i in range(301)] for j in range(n+1)]

for p,q,c in PQ:
  if c<=k:
    DP[2][q][c]+=1
for i in range(2,n):
  for p,q,c in PQ:
    for j in range(k+1-c):
      DP[i+1][q][j+c]+=DP[i][p][j]
      if DP[i+1][q][j+c]>mod:
        DP[i+1][q][j+c]=DP[i+1][q][j+c]%mod
ans=0
for i in range(301):
  ans+=DP[n][i][k]
print(ans)
0