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. xml-apis.jar getTextContent() jar包冲突解决(getTextContent()方法无法找到)

    1.引用包: import org.w3c.dom.Document;import org.w3c.dom.Element;import org.w3c.dom.NodeList; 2.方法中应用: ...

  2. Codeforces Round #197 (Div. 2) A. Helpful Maths【字符串/给一个连加计算式,只包含数字 1、2、3,要求重新排序,使得连加的数字从小到大】

    A. Helpful Maths time limit per test 2 seconds memory limit per test 256 megabytes input standard in ...

  3. Quarz框架学习

    参考博客:https://www.cnblogs.com/zhanghaoliang/p/7886110.html

  4. 视觉暂留-Info:这些神奇的“视觉暂留”动画,每一幅都让人拍案叫绝!

    ylbtech-视觉暂留-Info:这些神奇的“视觉暂留”动画,每一幅都让人拍案叫绝! 1.返回顶部 1. 这些神奇的“视觉暂留”动画,每一幅都让人拍案叫绝! 原创|发布:2018-05-28 19: ...

  5. C++之以分隔符的形式获取字符串

    void CConvert::Split(const std::string& src, const std::string& separator, std::vector<st ...

  6. 【转载】获取更多/proc/fd中有关socket的信息

    Q: Looking in /proc/$mypid/fd/, I see these files lrwx------ cm_user cm_user Oct : -> /dev/pts/ ( ...

  7. hdu 1272 使用set和并查集

    http://acm.hdu.edu.cn/showproblem.php?pid=1272 这道题就是求图是不是连通无环,我觉得其实就是看看图是不是一棵最小生成树. 所以要是图满足条件,就必然有n个 ...

  8. 2019-11-1-asp-dotnet-core-简单开发P2P中央服务器

    title author date CreateTime categories asp dotnet core 简单开发P2P中央服务器 lindexi 2019-11-01 19:40:33 +08 ...

  9. el-dialog 一些问题 局中滚动

    .el-dialog { position: absolute; top: 50%; left: 50%; margin: 0 !important; transform: translate(-50 ...

  10. font-weight:bolder与设置数值的区别

    我之前设置了font-weight:bolder;一直不明白为什么在浏览器上显示最后的效果就变成了normal呢,后来查了一下才发现bolder是相对父元素的. 如果父对象的值为 normal,子对象 ...