「CF1240X」Codeforces Round #591 (Div. 1)

2019年10月8日3,0716

A. Save the Nature
二分答案,计算一下 x% y% (x + y)% 的票的数量,贪心地让贵的比例最高

B. Sequence Sorting

离散化以后,则不用移动的数的数值是连续的一段,递推一下最长连续的序列,或者双指针实现

C. Paint the Tree

每个点只能选择不超过 𝑘 个相连的边,dp 一下,f[x] 表示选了 x 和其父亲的边,g[x] 表示没选

转移的时候,贪心选收益前 k 大的边

avatar
2 Comment threads
4 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
2 Comment authors
hzwerLV24twx Recent comment authors
  Subscribe  
提醒
LV24twx
LV24twx

黄学长是拿小号交的?

LV24twx
LV24twx

昨晚的比赛黄学长咋只过了一题就不干了啊,B题面后来改了啊。