Codeforces Round #406 (Div. 1)】的更多相关文章

B. Legacy 题目连接: http://codeforces.com/contest/786/problem/B Description Rick and his co-workers have made a new radioactive formula and a lot of bad guys are after them. So Rick wants to give his legacy to Morty before bad guys catch them. There are…
A. Berzerk 题目连接: http://codeforces.com/contest/786/problem/A Description Rick and Morty are playing their own version of Berzerk (which has nothing in common with the famous Berzerk game). This game needs a huge space, so they play it with a computer…
http://codeforces.com/contest/787/problem/E 题目大意:给你n块,每个块都有一个颜色,定义一个k,表示在区间[l,r]中最多有k中不同的颜色.另k=1,2,3...n,问在每一种情况下,输出能划分出的最小的段落数. 例如: 51 3 4 3 3 ans = 4, 2, 1, 1, 1 [1], [3], [4], [3, 3] [1], [3, 4, 3, 3] [1, 3, 4, 3, 3] [1, 3, 4, 3, 3] [1, 3, 4, 3, 3…
http://codeforces.com/contest/787/problem/D 题目大意:有n个点,三种有向边,这三种有向边一共加在一起有m个,然后起点是s,问,从s到所有点的最短路是多少? 第一种边:u->v w 表示节点u到v有连接一条有向边,权值为w 第二种边:u->[l,r] w  表示节点u到区间[l,r]连接一条有向边,权值为w 第三种边:[l,r]->u w  表示区间[l, r]所有的节点到u都有一条有向边,权值为w 思路: 我们知道,对于dijstra都是用pr…
http://codeforces.com/contest/787/problem/C 题目大意:有一个长度为n的环,第1个位置是黑洞,其他都是星球.已知在星球上(不含第一个黑洞)有一位神.有两个人,每个人有一个集合的数字,两人进行游戏,每人每轮可以让神从一个星球向后移动x位(x为目前两个人所拥有的集合中的一个任意数字,数字可以重复选).请求出神在2~n的每一个位置上时,两人分别先手的输赢情况,先手胜利输出WIN,先手必败输出LOOS,会无限循环输出LOOP. 思路:经典的有向图博弈(可惜我不会…
B. Legacy 题目连接: http://codeforces.com/contest/786/problem/B Description Rick and his co-workers have made a new radioactive formula and a lot of bad guys are after them. So Rick wants to give his legacy to Morty before bad guys catch them. There are…
B题打错调了半天,C题想出来来不及打,还好没有挂题 AC:AB Rank:96 Rating:2125+66->2191 A.Berzerk 题目大意:有一个东东在长度为n的环上(环上点编号0~n-1),两个玩家,玩家1有a种操作可选,玩家2有b种操作可选,每种操作可以让这个东东向前走若干步,两个玩家轮流操作,谁先让东东走到0谁胜,求出双方都选最优操作的情况下,东东开始在1~n-1各位置时玩家1先手和玩家2先手会必胜,必败还是无限循环.(a,b<n<=7000) 思路:类似DFS或者BF…
来自FallDream的博客,未经允许,请勿转载,谢谢. ------------------------------------------------------- 大家好,我是一个假人.在学习OI的过程中,我凭借自己的努力,成功发明出了大顶的dij,并且帮助自己在cf和模拟赛上多过了 -2 道题.发明算法真美妙! -------------------------------------------------------- 不说了,D题因为dij打成大顶的挂了,血都吐出来了.A题瞎特判f…
D. Legacy time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Rick and his co-workers have made a new radioactive formula and a lot of bad guys are after them. So Rick wants to give his legacy…
A 一看到题,不是一道解不定方程的裸题吗,调了好久exgcd. 其实一个for就好了啊 B 一直WA ON TEST 7真是烦,一想会不会是编号太大了,又写了一个map版本,无用. 调了好久好久才发现有几次询问没有读完mmp C 调了一晚上,又看了数篇题解,终于看懂了QAQ 这是一道博弈论,借助图论/DP帮助完成. 博弈中有3种状态:必胜,必败,不一定 而我们需要将这些状态一直转移以求得结果. 如果A无论怎么移动,使B下一步必胜,则A的现在状态为必败.如果A可以移动任意一步,使B下一步必败,则A…