My birthday is coming up and traditionally I'm serving pie. Not just one pie, no, I have a numberN of them, of various tastes and of various sizes. F of my friends are coming to my party and each of them gets a piece of pie. This should be one piece…
ACM International Collegiate Programming Contest World Finals 2014 A - Baggage 题目描述:有\(2n\)个字符摆在编号为\(1\)~\(2n\)格子里,奇数位为\(B\),偶数位为\(A\),另外编号为\((-2n+1)\)~\(0\)的格子是空的,现在可以移动两个相邻的字符,移动到两个空的格子里,最终使得全部\(A\)在全部\(B\)的左边,而且字符都是连续的,但不必放回原位,输出最小步数的方案. solution…
ACM International Collegiate Programming Contest World Finals 2013 A - Self-Assembly 题目描述:给出\(n\)个正方形组件,正方形每条边有一个标签,标签可能是00,表示这条边不能与其它边相拼,也可能是一个字母加正号或负号,相同字母不同符号的边可以相拼.每个组件有无限个,问利用这些组件是否能拼出一个无限大的多边形. solution 拆点,每个正方形拆成\(4\)个点,每条边一个,然后每条边拆成两个点(出点和入点)…
ACM International Collegiate Programming Contest, Tishreen Collegiate Programming Contest (2018) Syria, Lattakia, Tishreen University, April, 30, 2018 Problem A. Can Shahhoud Solve it? Problem B. Defeat the Monsters Problem C. UCL Game Night Problem…
Solved A Gym 100712A Who Is The Winner Solved B Gym 100712B Rock-Paper-Scissors Solved C Gym 100712C Street Lamps Solved D Gym 100712D Alternating Strings Solved E Gym 100712E Epic Professor Solved F Gym 100712F Travelling Salesman Solved G Gym 10071…
F. Palindrome Problem Description A string is palindrome if it can be read the same way in either direction, for example "maram" is palindrome, while "ammar" is not. You are given a string of n characters, where each character is eithe…
F. Monkeying Around 维护点在多少个线段上 http://codeforces.com/gym/101350/problem/F 题意:有m个笑话,每个笑话的区间是[L, R],笑话种类有1e5,一开始所有猴子都在凳子上,听到一个笑话,就倒下,但是如果是听过的笑话,就重新回到凳子上.问最终有多少个猴子在凳子上. 相当于有1e5个线段,如果我们能知道第i个猴子,被多少个线段覆盖了,那么可以找出那些线段中的最后那一条,就是最后覆盖上去的那一条,那条线段是哪一个笑话,设为k,如果…