Codeforces Round #190 (Div. 1 + Div. 2)
A. Ciel and Dancing
- 模拟。
B. Ciel and Flowers
- 混合类型的数量只能为0、1、2,否则3个可以分成各种类型各自合成。
C. Ciel and Robot
- 考虑一组命令得到的点集,那么后面的点的起始点会对应于其中点集中的一个点。
D. Ciel and Duel
- 两种策略:
- atk-atk:一个取最小的前若干个,一个取最大的若干个。
- atk-def、atk:对于def状态的,需要优先取最靠近的值抵消,剩余atk状态的也是取最近的。
E. Ciel the Commander
- 0应该设置成尽可能通过多的点对,此时树会变成若干棵子树,则变成了子问题,那么显然是点分治了。
F. D. Ciel and Flipboard
- 枚举第\(x\)行的翻转状态。
- 对于\(i \lt x\)的行来说,在不影响\(x\)行状态的条件下,\((i,j)\)和\((i+x+1,j)\)的翻转状态总是一致的。
- 考虑\(i<x\)的行,在不影响其他列的条件下,\((i,j)\)和\((i, j+x+1)\)的翻转状态应该是一致的。
- \(j=x\)的列需要单独考虑,如果不翻转,则对其他列无影响。如果翻转,那么对于所有\(j<x\)的点\((i, j)\)和\((i, j+x+1)\)的翻转状态总是相反的。
- 于是对于每一行来说,相对于其他行都是独立的。考虑\(j=x\)的翻转状态,可以得到两种类型的和,\[type0=max(a(i,j)+a(i, j+x+1), -a(i,j)-a(i,j+x+1))\\type1=max(a(i,j)-a(i,j+x+1),-a(i,j)+a(i,j+x+1))\]
G. Ciel and Gondolas
- 朴素的dp做法容易想:\(dp(i,j)\)表示用\(i\)辆车拉走\(j\)个人的最小代价,复杂度\(O(n^2k)\)。
- \(opt(i,j)\)表示\(dp(i,j)\)的最优决策点,可证明\(opt(i,j)\le opt(i,j+1)\)。
- 根据决策点的单调性,可以使用分块dp优化,时间复杂度\(O(nklogn)\)。
Codeforces Round #190 (Div. 1 + Div. 2)的更多相关文章
- Educational Codeforces Round 60 (Rated for Div. 2) - C. Magic Ship
Problem Educational Codeforces Round 60 (Rated for Div. 2) - C. Magic Ship Time Limit: 2000 mSec P ...
- Educational Codeforces Round 60 (Rated for Div. 2) - D. Magic Gems(动态规划+矩阵快速幂)
Problem Educational Codeforces Round 60 (Rated for Div. 2) - D. Magic Gems Time Limit: 3000 mSec P ...
- Educational Codeforces Round 43 (Rated for Div. 2)
Educational Codeforces Round 43 (Rated for Div. 2) https://codeforces.com/contest/976 A #include< ...
- Educational Codeforces Round 35 (Rated for Div. 2)
Educational Codeforces Round 35 (Rated for Div. 2) https://codeforces.com/contest/911 A 模拟 #include& ...
- Codeforces Educational Codeforces Round 44 (Rated for Div. 2) F. Isomorphic Strings
Codeforces Educational Codeforces Round 44 (Rated for Div. 2) F. Isomorphic Strings 题目连接: http://cod ...
- Codeforces Educational Codeforces Round 44 (Rated for Div. 2) E. Pencils and Boxes
Codeforces Educational Codeforces Round 44 (Rated for Div. 2) E. Pencils and Boxes 题目连接: http://code ...
- Educational Codeforces Round 63 (Rated for Div. 2) 题解
Educational Codeforces Round 63 (Rated for Div. 2)题解 题目链接 A. Reverse a Substring 给出一个字符串,现在可以对这个字符串进 ...
- Educational Codeforces Round 39 (Rated for Div. 2) G
Educational Codeforces Round 39 (Rated for Div. 2) G 题意: 给一个序列\(a_i(1 <= a_i <= 10^{9}),2 < ...
- Educational Codeforces Round 48 (Rated for Div. 2) CD题解
Educational Codeforces Round 48 (Rated for Div. 2) C. Vasya And The Mushrooms 题目链接:https://codeforce ...
- Educational Codeforces Round 60 (Rated for Div. 2) 题解
Educational Codeforces Round 60 (Rated for Div. 2) 题目链接:https://codeforces.com/contest/1117 A. Best ...
随机推荐
- ylbtech-自信:自信
ylbtech-自信:自信 自信心(confidence),在心理学中,与其最接近的是班杜拉(A.Bandura)在社会学习理论中提出的自我效能感 (self-efficacy)的概念,是指个体对自身 ...
- Mybatis使用 爬坑记录
1.mapper.xml可以直接 使用map集合, parameterType="java.util.Map" resultType="java.util.Map&quo ...
- Dubbo+JStorm
Dubbo,是阿里巴巴服务化治理的核心框架,并被广泛应用于阿里巴巴集团的各成员站点.阿里巴巴近几年对开源社区的贡献不论在国内还是国外都是引人注目的,比如:JStorm捐赠给Apache并加入Apach ...
- CMD格式数据表输出语句
mysql --default-character-set=latin1 -uroot -p
- Intersection of Two Linked Lists两链表找重合节点
Write a program to find the node at which the intersection of two singly linked lists begins. For ex ...
- day16 web前端之JavaScript
页面布局补充 样例页面: 示例代码: <!DOCTYPE html> <html lang="en"> <head> <meta char ...
- 权限系统的设计模式 ACL RBAC ABAC
ACL(Access Control List):访问权限列表 如: user1-->AC1 user1-->AC2 user2-->AC1 此时权限汇总成一个列表 这种设计 ...
- Directx11教程41 纹理映射(11)
原文:Directx11教程41 纹理映射(11) 1.第一副图我们采用各性异性的滤波方式,并设置最大各性异性值为8. samplerDesc.Filter = D3D11_FILT ...
- es6中的(=>)箭头函数
x => x * x 上面的箭头函数相当于: function (x) { return x * x; } 箭头函数相当于匿名函数,并且简化了函数定义. 箭头函数有两种格式,一种像上面的,只包含 ...
- python 数据分析领域常用的包