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 ...
随机推荐
- 最短路 HDU - 2544 (dijkstra算法或Floyd算法)
Dijkstra解法: #include <stdio.h> #include <iostream> #include <cstring> #include < ...
- Sass @at-root (2)
@at-root和&的结合 &在Sass中所起的作用,文章开头就简单的进行演示了.在@at-root中也同样可以配合&一起使用,下面我们同样来看几个用例: SCSS .foo ...
- 如何用KNIME进行情感分析
Customer Intelligence Social Media Finance Credit Scoring Manufacturing Pharma / Health Care Retail ...
- C#创建日志方法
1.通过流的方式 public void WriteLog(string log) { StreamWriter stream; string path = "D:/WriteLog/&qu ...
- thrift python安装
http://thrift.apache.org/download/ tar -zxvf thrift-0.11.0.tar.gz cd thrift-0.11.0 ./configure --pre ...
- win7 powershell版本过低问题
那台win8系统的笔记本电脑 硬盘坏掉后 在win7系统的台式机上使用 vagrant up 提示版本过低 The version of powershell currently installed ...
- 小爬爬5:scrapy介绍3持久化存储
一.两种持久化存储的方式 1.基于终端指令的吃持久化存储: 特点:终端指令的持久化存储,只可以将parse方法的返回值存储到磁盘文件 因此我们需要将上一篇文章中的author和content作为返回值 ...
- Spark in action on Kubernetes - 存储篇(一)
前言 在上篇文章中,我们分析了Spark Operator内部的机制,今天我们会讨论一个在大数据领域中最重要的话题 - 存储.大数据已经无声无息的融入了每个人的生活中.大到旅游买房,小到外卖打车,都可 ...
- 利用阿里云容器服务打通TensorFlow持续训练链路
本系列将利用Docker和阿里云容器服务,帮助您上手TensorFlow的机器学习方案 第一篇:打造TensorFlow的实验环境 第二篇:轻松搭建TensorFlow Serving集群 第三篇:打 ...
- HZOJ 数颜色
一眼看去树套树啊,我可能是数据结构学傻了…… 是应该去学一下莫队进阶的东西了. 上面那个东西我没有打,所以这里没有代码,而且应该也不难理解吧. 这么多平衡树就算了,不过线段树还是挺好打的. 正解3: ...