SRM 146 DIV1 800】的更多相关文章

Problem Statement      The purpose of a roundabout is to control the flow of traffic at a busy intersection. A roundabout has 4 entry points: from the North, East, South and West; and 4 exit points at the same locations (see Example 0 for a diagram).…
Problem Statement      Masterbrain is a two player board game in which one player decides on a secret combination of digits, while the other must figure it out in 10 guesses or less. The game differs from Mastermind in that the player making the secr…
Topcoder SRM 643 Div1 250 Problem 给一个整数N,再给一个vector<long long>v; N可以表示成若干个素数的乘积,N=p0*p1*p2*......*pn,我们假设p0,p1,...,pn是单调不降的,那么v里存储的是下标为偶数 的N的质因数p0,p2,p4,...,p(2k).现在要求写一个程序,返回一个vector<long long>ans; ans里存储的是p0,p1,p2,...,pn. Limits Time Limit(m…
Topcoder Srm 726 Div1 Hard 解题思路: 问题可以看做一个二分图,左边一个点向右边一段区间连边,匹配了左边一个点就能获得对应的权值,最大化所得到的权值的和. 然后可以证明一个结论,将点按照权值大小排序后,从大到小加点的充要条件是完美匹配大小 \(+1\) .考虑如果不是按照这种方式加点的,必然能找到一个没有被匹配的点替换掉一个在匹配中但是权值比它小的点,答案一定会变大. 于是我们可以从大到小枚举点,如果能加进去且完美匹配大小增加就加入这个点,否则就不加. solutoin…
Problem Statement      You are a genealogist specializing in family trees of vampires. Vampire family trees differ from human family trees. In particular, vampires are "born" in a different way. The only way to create a new vampire is that an ex…
A 裸最短路. class TravelOnMars { public: int minTimes(vector <int>, int, int); }; vector<int> e[maxn]; int n; int dist(int a,int b) { if (a>b) swap(a,b); int res = min( b-a , a+n-b); return res; } int d[maxn],inq[maxn]; queue<int> q; int…
转载请注明出处,谢谢viewmode=contents">http://blog.csdn.net/ACM_cxlove?viewmode=contents    by---cxlove 水水更健康,最终回到1800+了... DIV2 1000pt 显然每一列是独立的.分开考虑. 对于某一列.假设按单个字符U , D从下往上考虑的话.发现连续两个U的话.以下的U能够移动的位置受上面一个影响. 只是因此能够想到相邻的U , D互相限制位置,能够依次处理.相邻同样字符的话. 能够作为一个字符…
打卡- Easy(250pts): 题目大意:rating2200及以上和2200以下的颜色是不一样的(我就是属于那个颜色比较菜的),有个人初始rating为X,然后每一场比赛他的rating如果增加就会加D[i],如果减就会减D[i],但是如果rating小于0了就变成0,这个人不太喜欢比较厉害的颜色,所以他不能连续两次rating大于等于2200,求颜色变化的最多个数,保证比赛最多50场,D[i]<=10^9. 这套题还是很难的,所以我们来好好分析. 首先,样例0告诉我们贪心什么都是假的,不…
Problem Statement      Cat Noku has just finished writing his first computer program. Noku's computer has m memory cells. The cells have addresses 0 through m-1. Noku's program consists of n instructions. The instructions have mutually independent ef…
Problem Statement      Wolf Sothe and Cat Snuke are playing a card game. The game is played with exactly 100 cards. The cards are numbered from 1 to 100. The game is played as follows: First, Cat Snuke chooses the goal: an integer N between 1 and 100…