layout: post
title: Codeforces Round 267(Div. 2)
author: "luowentaoaa"
catalog: true
tags:
mathjax: true
- codeforces
- DP
- SPFA
- 贪心数组
传送门post
很明显\(k\)组的答案从\(k-1\)组得来,并且第\(i\)个位置的答案只能从\(i-m\)的位置以及以前转移过来spa
很明显,维护一个\(num\)数组储存\(i-m\)及其以前的各组答案的最大值便可code
根据长度和K的数量做为权值,根据字典关系建图,而后跑一个bfs(spfa)get
由于题目限制,因此咱们能够用个栈和map维护第三个数和第二个数的先后位置it