Codeforces Round 267(Div. 2)


layout: post
title: Codeforces Round 267(Div. 2)
author: "luowentaoaa"
catalog: true
tags:
mathjax: true
- codeforces
- DP
- SPFA
- 贪心数组


传送门post

A - George and Accommodation(签到)

思路

B - Fedor and New Game(暴力)

C - George and Job (基础DP)

思路

很明显\(k\)组的答案从\(k-1\)组得来,并且第\(i\)个位置的答案只能从\(i-m\)的位置以及以前转移过来spa

很明显,维护一个\(num\)数组储存\(i-m\)及其以前的各组答案的最大值便可code

D - Fedor and Essay (建图spfa)

思路

根据长度和K的数量做为权值,根据字典关系建图,而后跑一个bfs(spfa)get

[E - Alex and Complicated Task]https://codeforces.com/contest/467/problem/E) (贪心)

思路

由于题目限制,因此咱们能够用个栈和map维护第三个数和第二个数的先后位置it

相关文章
相关标签/搜索