Regroup Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1057 Accepted Submission(s): 297 Problem Description When ALPC42 got to a panzer brigade, He was asked to build software to help them r…
题意:给定N,M,然后给出M组信息(u,v,l,r),表示u到v有[l,r]范围的通行证有效.问有多少种通行证可以使得1和N连通. 思路:和bzoj魔法森林有点像,LCT维护最小生成树. 开始和队友在想维护连通性,而不是维护树,这样好像会很麻烦. 队友yy了一个算法:用线段树模拟并查集维护连通性.(发现和标程有点像? 我的代码:LCT维护最小生成树. ...先给代码,后面补一下题解. #include<bits/stdc++.h> #define ll long long using nam…
A. Broken Clock time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You are given a broken clock. You know, that it is supposed to show time in 12- or 24-hours HH:MM format. In 12-hours format…
Marriage Match II Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3558 Accepted Submission(s): 1158 Problem Description Presumably, you all have known the question of stable marriage match. A…
A Bug's Life Time Limit: 15000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 13709 Accepted Submission(s): 4449 Problem Description Background Professor Hopper is researching the sexual behavior of a rare…
Problem Description 自从Lele开发了Rating系统,他的Tetris事业更是如虎添翼,不久他遍把这个游戏推向了全球.为了更好的符合那些爱好者的喜好,Lele又想了一个新点子:他将制作一个全球Tetris高手排行榜,定时更新,名堂要比福布斯富豪榜还响.关于如何排名,这个不用说都知道是根据Rating从高到低来排,如果两个人具有相同的Rating,那就按这几个人的RP从高到低来排.终于,Lele要开始行动了,对N个人进行排名.为了方便起见,每个人都已经被编号,分别从0到N-1…
题目链接 描述 A supermarket has a set Prod of products on sale. It earns a profit px for each product x∈Prod sold by a deadline dx that is measured as an integral number of time units starting from the moment the sale begins. Each product takes precisely o…
Zjnu Stadium Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2672 Accepted Submission(s): 1028 Problem Description In 12th Zhejiang College Students Games 2007, there was a new stadium built…
Segment set Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4479 Accepted Submission(s): 1672 Problem Description A segment and all segments which are connected with it compose a segment set.…
These days, you can do all sorts of things online. For example, you can use various websites to make virtual friends. For some people, growing their social network (their friends, their friends' friends, their friends' friends' friends, and so on), h…
Werewolf Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 1381 Accepted Submission(s): 386 Problem Description "The Werewolves" is a popular card game among young people.In the basic ga…
//有n个成员,并查集开两倍空间 //1~n为一组, n+1~2n为一组.a与b互斥,则a与b反(即b+n)为同一集合, //同时b与a反(a+n)为同一集合 //在union操作中,引入w ,w越大,表面它的根连接的点越多 //合并时确立关系 #include<iostream> using namespace std; const int N=1e6; int p[N]; int w[N]; int find(int x) { if(p[x]!=x) p[x]=find(p[x]); re…
As we know, Rikka is poor at math. Yuta is worrying about this situation, so he gives Rikka some math tasks to practice. There is one of them: Yuta has a non-direct graph with n vertices and n+1 edges. Rikka can choose some of the edges (at least one…
Is It A Tree? Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 23312 Accepted Submission(s): 5338 Problem Description A tree is a well-known data structure that is either empty (null, void, no…
小希的迷宫 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 47553 Accepted Submission(s): 14818 Problem Description 上次Gardon的迷宫城堡小希玩了很久(见Problem B),现在她也想设计一个迷宫让Gardon来走.但是她设计迷宫的思路不一样,首先她认为所有的通道都应该是…
Play on Words HDU - 1116 Some of the secret doors contain a very interesting word puzzle. The team of archaeologists has to solve it to open that doors. Because there is no other way to open the doors, the puzzle is very important for us. There is a…