Codeforces Round #180 (Div. 1 + Div. 2)
A. Snow Footprints
- 如果只有L或者只有R,那么起点和终点都在边界上,否则在两者的边界。
B. Sail
- 每次根据移动后的曼哈顿距离来判断是否移动。
C. Parity Game
- 如果当前1的个数是偶数,则1的个数不会再增加;如果是奇数,则加1后不会再增加。
- 当前串可以组合成任意种组合,组合中的1不超过最大值。
D. Fish Weight
- \(Diff = \sum{di\cdot wi}\)
- 假设\(w_1+=dw\),因为有\(0<w_1<=w_2<=\cdots<=w_n\),所以对于所有\(1<i,w_i+=dw\),此时\(w_1\)的贡献=\(dw\cdot\sum{d_i}\)。
- 同理,推得\(w_i\)的贡献为\[dw_i\cdot\sum_{j=i}^{n}{d_j}\]
- 当存在\(\sum_{j=i}^{n}{d_j}>0\)时,可设对应\(dw_i\)为无穷大,即可使结果为正数。
E. Splitting the Uniqueness
D. Color the Carpet
- 同一行的限制用两种颜色就满足。
- 不同行之间的限制要么小于一半,要么大于一半。小于一半时,颠倒颜色即可变成大于一半。
- 上面两种操作即可满足\(\frac{3}{4}\)的这个条件。
E. Mystic Carvings
- 3个区间的相交情况一共只有5种情况,其中两种合法:两两不相交和两两都相交。
- 0个交点且不合法的方案是形成“三”字形,这种情况我们可以枚举中间的区间,那么此时会包含另外的某个区间,也就是如果我们统计出被中间区间包含的区间个数以及与中间区间相交的区间个数,就可以计算这种方案的数量。
- 1个交点和2个交点且不合法的方案,可以枚举有交点的一个区间,可以统计与当前区间相交的区间数量,剩下可以计算与当前区间不相交的数量(此时这些区间可能与第二条不相交,即1个交点或与第二条相交,即2个交点)。注意方案会重复计数,所以最后需要除以2。
Codeforces Round #180 (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 ...
随机推荐
- NSURLSessionDownloadTask的深度断点续传
http://www.cocoachina.com/ios/20160503/16053.html 本文为投稿文章,作者:WeiTChen 对于后台下载与断点续传相信大家肯定不会陌生,那么如果要同时实 ...
- 2018-12-25-Roslyn-如何使用-MSBuild-Copy-复制文件
title author date CreateTime categories Roslyn 如何使用 MSBuild Copy 复制文件 lindexi 2018-12-25 9:35:8 +080 ...
- 足迹地图 搜索jvectormap
https://blog.wangjunfeng.com/foot_print/
- SQLServer —— 数据类型的转换
一.使用convert函数实现强制转换 例如我们现在有如下一张学员成绩表: 现在想查询学号等于100003的学员总成绩,并按照要求打印出来,我们可以这样实现: 结果报错,因为最后一句字符串不能和数值相 ...
- day39-Spring 13-Spring的JDBC模板:默认连接池的配置
Spring内置的连接池DriverManagerDataSource的源码. /* * Copyright 2002-2008 the original author or authors. * * ...
- phpmyadmin误删表后的恢复过程
转自:http://blog.csdn.net/ssrc0604hx/article/details/18717983 话说今天不知道是抽风了还是失魂了,在用phpmyadmin删除测试数据时,竟然将 ...
- css面试题总结(转)
转自此网页http://www.cnblogs.com/YangqinCao/p/5721810.html. 1.两栏布局,左边栏宽度固定,适应父元素高度变化 首先分析两栏布局, 两栏布局两种常见方法 ...
- AtCoder Beginner Contest 084 C - Special Trains
Special Trains Problem Statement A railroad running from west to east in Atcoder Kingdom is now comp ...
- 在window.onload中使用setTimeout
window.onload = function(){ function n(i){ alert(1); } setTimeout('n(1)',2000); } 以上代码会报错:n() is not ...
- shell学习(15)- eval及shell No such file or directory解决办法
eval可以读取一连串的参数,然后按照参数特性来执行.参数数目不限,彼此之间用分号隔开. eval会对后面的命令进行两遍扫描,如果第一遍扫描后,命令是个普通命令,则执行此命令:如果命令中含有变量的间接 ...