A. Circle Line

  • 考虑环上的最短距离。

B. New Problem

  • \(n\) 个串建后缀自动机。
  • 找的时候bfs一下即可。

C. Learning Languages

  • 并查集维护可以沟通的人。
  • 注意会0种语言的人必然要学习。

D. Set of Points

  • 构造类似于\(y = \frac{1}{x}\) 的两条曲线即可。

E. Game

  • 本质其实就是个Nim博弈。
  • 若先手胜,要找出第一步的可行解,即判断\[sg\ xor\ a_i \le a_i\]

D. Google Code Jam

By the Google Code Jam rules the time penalty is the time when the last correct solution was submitted.

  • 对于probFail=0的题目,如果要解决的话,必然是放在probFail前面。
  • 对于probFail=1的题目,显然不会去浪费时间。
  • 剩下的就是0<probFail<1的题目之间的相对顺序了,考虑两道题目\(i,j\)的相对顺序,因为得分不会相互影响,只需要考虑罚时即可。
  • \[(t_i+t_j)(1-p_j)+t_i(1-p_i)p_j<(t_j+t_i)(1-p_i)+t_j(1-p_j)p_i \\ \frac{t_ip_i}{1-p_i} < \frac{t_jp_j}{1-p_j}\]
  • 根据上述不等式对题目排序,\(dp(i,j)\)表示前\(i\)道题目花费\(j\)时间的最优值。

E. Binary Tree on Plane

  • 除了根节点外,其余节点均有1个父节点,那么就可以构出一张二分图:左边表示父节点,右边表示儿子节点,跑一遍最小费用流即可。最大流需要等于\(n-1\)。

Codeforces Round #170 (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. Faster RCNN算法训练代码解析(1)

    这周看完faster-rcnn后,应该对其源码进行一个解析,以便后面的使用. 那首先直接先主函数出发py-faster-rcnn/tools/train_faster_rcnn_alt_opt.py ...

  2. jquery中的index方法和eq方法

    jquery的index()方法 搜索匹配的元素,并返回相应元素的索引值,从0开始计数,如果不给 .index() 方法传递参数,那么返回值就是这个jQuery对象集合中第一个元素相对于其同辈元素的位 ...

  3. ObjectIntputStream / ObjectOutputStream 类

    使用 ObjectInputStream 类 ObjectOutputStream类 将对象整体 读 / 写文件中: [读写对象] 1. ObjectInputStream类 (1)基本概念 java ...

  4. cmake时选择的VS生成器

    运行cmake --help 在得到的输出中可以得到下面的结果:

  5. jQuery打飞机游戏

    在线演示 本地下载

  6. iOS 小 Tip:优化侧滑返回与 ScrollView 的兼容性

    http://www.cocoachina.com/ios/20150909/13369.html 作者:@周楷雯Kevin 授权本站转载. 倘若在 ViewController 中添加了一个 Tab ...

  7. "NetworkError: 404 Not Found fontawesome-webfont.woff?v=4.0.3

    This worked for me: Add the following lines to your web.config <system.webServer> <staticCo ...

  8. Linux常用命令1 文件处理命令

    1.命令格式 1.用中括号括起来的内容都不是必填内容,碧如上图的选项和参数,有些命令不写选项和参数也可以执行 2.注意图中的简化选项与完整选项说明,完整选项要两个横杆-- 2.目录处理命令ls 1.文 ...

  9. php中括号定义数组

    php5.3及之前的版本是不支持中括号定义数组的.5.4之后支持. 错误信息是,不识别“[”

  10. 【调试】Visual Studio 调试小技巧(2)-从查看窗口得到更多信息(转载)

    在使用Visual Studio开发调试程序时,我们经常需要打开查看窗口(Watch)来分析变量.有时在查看窗口显示的内容不是很直观.为了能从查看窗口的变量中得到更多的信息,我们需要一些小的技巧.下面 ...