A Bug's Life Time Limit: 15000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 8528 Accepted Submission(s): 2745 Problem Description Background Professor Hopper is researching the sexual behavior of a rare
Long time ago, there was a great kingdom and it was being ruled by The Great Arya and Pari The Great. These two had some problems about the numbers they like, so they decided to divide the great kingdom between themselves. The great kingdom consisted
就是给一个无向图判是否有奇环 用带权并查集来做,边权1表示连接的两个节点异性,否则同性,在%2意义下进行加法运算即可,最后判相同的时候也要%2,因为可能有负数 #include<iostream> #include<cstdio> using namespace std; const int N=1000005; int T,n,m,f[N],s[N]; int read() { int r=0,f=1; char p=getchar(); while(p>'9'||p<
Now and then you play the following game with your friend. Your friend writes down a sequence consisting of zeroes and ones. You choose a continuous subsequence (for example the subsequence from the third to the fifth digit inclusively) and ask him,
HDU3047 Zjnu Stadium Problem Description In 12th Zhejiang College Students Games 2007, there was a new stadium built in Zhejiang Normal University. It was a modern stadium which could hold thousands of people. The audience Seats made a circle. The to
设相等的边权为0,吃的边权为,被吃的边权为2,然后用带权并查集在%3的意义下做加法即可 关系为简单环的基本都可以用模环长的方式是用带权并查集 #include<iostream> #include<cstdio> using namespace std; const int N=50005; int n,m,f[N],s[N],ans; int read() { int r=0,f=1; char p=getchar(); while(p>'9'||p<'0') { i