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. 【python之路19】文件操作

    一.打开文件 文件句柄 = open('文件路径', '模式') 打开文件时,需要指定文件路径和以何等方式打开文件,打开后,即可获取该文件句柄,日后通过此文件句柄对该文件操作. 打开文件的模式有: r ...

  2. LINUX下C++编程如何获得某进程的ID

    #include <stdio.h> #include <stdlib.h> #include <unistd.h> using namespace std; pi ...

  3. hdu 3068 最长回文(manacher入门)

    最长回文 Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submis ...

  4. 学习笔记(1)---matlab中常见函数解析

    一.fscanf函数 matlab中函数fscanf在文件读取方面的实例如下: 从文件中有格式地读数据 fscanf 语法1:[a,count]=fscanf(fid,format,size) 根据指 ...

  5. 洛谷P1681 最大正方形II

    P1681 最大正方形II 题目背景 忙完了学校的事,v神终于可以做他的“正事”:陪女朋友散步.一天,他和女朋友走着走着,不知不觉就来到 了一个千里无烟的地方.v神正要往回走,如发现了一块牌子,牌子上 ...

  6. 【JZOJ3213】【SDOI2013】直径

    ╰( ̄▽ ̄)╭ 小 Q最近学习了一些图论知识.根据课本,有如下定义. 树:无回路且连通的无向图,每条边都有正整数的权值来表示其长度.如果一棵树有N个节点,可以证明其有且仅有 N-1 条边. 路径:一棵 ...

  7. Unrecognised tag: 'build'

    [ERROR] [ERROR] Some problems were encountered while processing the POMs:[ERROR] Malformed POM H:\ec ...

  8. oracle如何限定特定IP访问数据库

    可以利用登录触发器.cmgw或者是在$OREACLE_HOME/network/admin下新增一个protocol.ora文件(有些os可能是. protocol.ora),9i可以直接修改sqln ...

  9. 【C++】去除vector里重复元素的方法比较

    背景:构造一个无重复的白名单,之后要在里面进行二分查找.故要求名单有序,且无重复,并且要进行二分查找,所以要采用有:随机访问迭代器类型的容器.这类容器有vector,array,deque.显然要ve ...

  10. poj 2236【并查集】

    poj 2236 Description An earthquake takes place in Southeast Asia. The ACM (Asia Cooperated Medical t ...