結果

問題 No.1111 コード進行
ユーザー googol_S0googol_S0
提出日時 2020-07-10 21:38:24
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,076 ms / 2,000 ms
コード長 543 bytes
コンパイル時間 263 ms
コンパイル使用メモリ 82,216 KB
実行使用メモリ 296,576 KB
最終ジャッジ日時 2024-04-19 16:17:18
合計ジャッジ時間 8,993 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 46 ms
59,136 KB
testcase_01 AC 45 ms
58,240 KB
testcase_02 AC 42 ms
52,608 KB
testcase_03 AC 42 ms
52,096 KB
testcase_04 AC 42 ms
52,096 KB
testcase_05 AC 52 ms
63,744 KB
testcase_06 AC 71 ms
68,864 KB
testcase_07 AC 72 ms
68,608 KB
testcase_08 AC 69 ms
66,688 KB
testcase_09 AC 65 ms
66,304 KB
testcase_10 AC 62 ms
70,016 KB
testcase_11 AC 63 ms
65,408 KB
testcase_12 AC 70 ms
69,248 KB
testcase_13 AC 60 ms
67,072 KB
testcase_14 AC 96 ms
83,072 KB
testcase_15 AC 58 ms
65,280 KB
testcase_16 AC 74 ms
71,680 KB
testcase_17 AC 60 ms
70,528 KB
testcase_18 AC 53 ms
61,824 KB
testcase_19 AC 50 ms
61,568 KB
testcase_20 AC 57 ms
65,152 KB
testcase_21 AC 52 ms
61,824 KB
testcase_22 AC 62 ms
72,576 KB
testcase_23 AC 63 ms
67,584 KB
testcase_24 AC 60 ms
67,200 KB
testcase_25 AC 81 ms
74,496 KB
testcase_26 AC 80 ms
70,144 KB
testcase_27 AC 62 ms
64,384 KB
testcase_28 AC 188 ms
182,144 KB
testcase_29 AC 130 ms
113,280 KB
testcase_30 AC 198 ms
136,448 KB
testcase_31 AC 78 ms
88,320 KB
testcase_32 AC 250 ms
135,296 KB
testcase_33 AC 250 ms
112,640 KB
testcase_34 AC 155 ms
155,776 KB
testcase_35 AC 191 ms
180,736 KB
testcase_36 AC 471 ms
180,736 KB
testcase_37 AC 194 ms
105,416 KB
testcase_38 AC 182 ms
89,600 KB
testcase_39 AC 359 ms
135,424 KB
testcase_40 AC 399 ms
176,768 KB
testcase_41 AC 256 ms
199,168 KB
testcase_42 AC 261 ms
127,360 KB
testcase_43 AC 260 ms
112,512 KB
testcase_44 AC 113 ms
91,136 KB
testcase_45 AC 203 ms
136,320 KB
testcase_46 AC 87 ms
83,328 KB
testcase_47 AC 1,076 ms
296,576 KB
testcase_48 AC 69 ms
72,960 KB
testcase_49 AC 88 ms
83,456 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M,K=map(int,input().split())
p,q,c=0,0,0
mod=10**9+7
G=[[] for i in range(300)]
for i in range(M):
  p,q,c=map(int,input().split())
  G[p-1].append((q-1,c))
DP=[[[0]*(K+1) for j in range(300)] for i in range(N+1)]
for i in range(300):
  DP[0][i][0]=1
for i in range(N):
  for j in range(300):
    for k in range(len(G[j])):
      for l in range(K+1):
        if l+G[j][k][1]<=K:
          DP[i+1][G[j][k][0]][l+G[j][k][1]]+=DP[i][j][l]
          DP[i+1][G[j][k][0]][l+G[j][k][1]]%=mod
P=0
for i in range(300):
  P+=DP[N-1][i][K]
print(P%mod)
0