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)的更多相关文章

  1. 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 ...

  2. 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 ...

  3. Educational Codeforces Round 43 (Rated for Div. 2)

    Educational Codeforces Round 43 (Rated for Div. 2) https://codeforces.com/contest/976 A #include< ...

  4. Educational Codeforces Round 35 (Rated for Div. 2)

    Educational Codeforces Round 35 (Rated for Div. 2) https://codeforces.com/contest/911 A 模拟 #include& ...

  5. 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 ...

  6. 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 ...

  7. Educational Codeforces Round 63 (Rated for Div. 2) 题解

    Educational Codeforces Round 63 (Rated for Div. 2)题解 题目链接 A. Reverse a Substring 给出一个字符串,现在可以对这个字符串进 ...

  8. 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 < ...

  9. Educational Codeforces Round 48 (Rated for Div. 2) CD题解

    Educational Codeforces Round 48 (Rated for Div. 2) C. Vasya And The Mushrooms 题目链接:https://codeforce ...

  10. Educational Codeforces Round 60 (Rated for Div. 2) 题解

    Educational Codeforces Round 60 (Rated for Div. 2) 题目链接:https://codeforces.com/contest/1117 A. Best ...

随机推荐

  1. 指定程序集的位置 | Microsoft Docs

    原文:指定程序集的位置 | Microsoft Docs 指定程序集的位置Specifying an Assembly's Location 2017/03/30 作者 使用<b a s e & ...

  2. 覆盖equals时请遵守通用约定

    Object类中非final修饰的方法有equals().hashCode().toString().finalize().clone()1.equals()方法不需要被覆盖的情况:1)实例化的对象只 ...

  3. node.js对象数据类型

    在这里复习下前端JS的数据类型:前端JS中的数据类型: 1.基本/原生/值类型 string.number.boolean.null.undefined 2.引用/对象类型    ES对象类型:Str ...

  4. 【Leetcode 滑动窗口】顺次数(1291)

    题目 我们定义「顺次数」为:每一位上的数字都比前一位上的数字大 1 的整数. 请你返回由 [low, high] 范围内所有顺次数组成的 有序 列表(从小到大排序).   示例 1: 输出:low = ...

  5. postman常用公共函数

    常用公共函数: 1).判断是否超时(assertNotTimeout):var hasResponse=postman.getResponseHeader('Content-Type')?true:f ...

  6. Leetcode804.Unique Morse Code Words唯一摩尔斯密码词

    国际摩尔斯密码定义一种标准编码方式,将每个字母对应于一个由一系列点和短线组成的字符串, 比如: "a" 对应 ".-", "b" 对应 &q ...

  7. Add Binary字符数字相加,字符串合成

    Given two binary strings, return their sum (also a binary string). For example,a = "11"b = ...

  8. 【JZOJ4888】【NOIP2016提高A组集训第14场11.12】最近公共祖先

    题目描述 YJC最近在学习树的有关知识.今天,他遇到了这么一个概念:最近公共祖先.对于有根树T的两个结点u.v,最近公共祖先LCA(T,u,v)表示一个结点x,满足x是u.v的祖先且x的深度尽可能大. ...

  9. 【JZOJ4833】【NOIP2016提高A组集训第3场10.31】Mahjong

    题目描述 解法 搜索. 代码 #include<stdio.h> #include<iostream> #include<string.h> #include< ...

  10. java jvm 参数 -Xms -Xmx -Xmn -Xss 调优总结

    常见配置举例  堆大小设置 JVM 中最大堆大小有三方面限制:相关操作系统的数据模型(32-bt还是64-bit)限制;系统的可用虚拟内存限制;系统的可用物理内存限制.32位系统 下,一般限制在1.5 ...