题目:http://poj.org/problem?id=3294 Life Forms Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 18549 Accepted: 5454 Description You may have wondered why most extraterrestrial life forms resemble humans, differing by superficial traits s…
Life Forms Description You may have wondered why most extraterrestrial life forms resemble humans, differing by superficial traits such as height, colour, wrinkles, ears, eyebrows and the like. A few bear no human resemblance; these typically have…
Life Forms Description You may have wondered why most extraterrestrial life forms resemble humans, differing by superficial traits such as height, colour, wrinkles, ears, eyebrows and the like. A few bear no human resemblance; these typically have ge…
题意:给你最多100个字符串,求最长的且是一半以上的字符串的公共子串,如果有多个,按字典序输出. 思路:先把各个串拼起来,中间加上一个之前未出现过的字符,然后求后缀.然后根据h数组和sa数组,求出最长的公共串. #include<stdio.h> #include<string.h> #include<algorithm> using std::sort; #define V 220000 int r[V],sa[V],h[V],a[V],b[V],X[V],Y[V];…
Life Forms Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 12484 Accepted: 3502 Description You may have wondered why most extraterrestrial life forms resemble humans, differing by superficial traits such as height, colour, wrinkles, e…
POJ 2112 Optimal Milking (二分+最短路径+网络流) Optimal Milking Time Limit: 2000MS Memory Limit: 30000K Total Submissions: 10176 Accepted: 3698 Case Time Limit: 1000MS Description FJ has moved his K (1 <= K <= 30) milking machines out into the cow pastu…
POJ 2289(多重匹配+二分) 把n个人,分到m个组中.题目给出每一个人可以被分到的那些组.要求分配完毕后,最大的那一个组的人数最小. 用二分查找来枚举. #include<iostream> #include<string> #include<cstring> #include<cstdio> using namespace std; int map[1010][510]; int vis[1010]; int link[1010][510]; int…
差分,然后二分长度mid,判断是把height按照min不小于mid分组,取最大最小的sa位置看是否>=mid即可,注意差分后最后答案要+1 #include<iostream> #include<cstdio> using namespace std; const int N=50005; int n,a[N],r[N],wa[N],wb[N],wsu[N],wv[N],sa[N],rk[N],he[N]; int read() { int r=0,f=1; char p=…
题目大意: 给定n个字符串,求出现在不小于k个字符串中的最长子串 基本思路: 二分长度,统计个数,一般套路,就是这个跟说好的不一样啊,我非得开2倍才不re,真他妈不爽,先二分找出长度,然后根据长度输出字符串: 代码如下: #include<cstdio> #include<cstring> using namespace std; typedef long long ll; const int inf = 0x3f3f3f3f; const int maxn = 200000+10…
Life Forms Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 16827 Accepted: 4943 Description You may have wondered why most extraterrestrial life forms resemble humans, differing by superficial traits such as height, colour, wrinkles, e…
Life Forms Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 12688 Accepted: 3552 Description You may have wondered why most extraterrestrial life forms resemble humans, differing by superficial traits such as height, colour, wrinkles, e…
Life Forms Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 16223 Accepted: 4763 Description You may have wondered why most extraterrestrial life forms resemble humans, differing by superficial traits such as height, colour, wrinkles, e…
http://poj.org/problem?id=3277 City Horizon Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 15255 Accepted: 4111 Description Farmer John has taken his cows on a trip to the city! As the sun sets, the cows gaze at the city horizon and o…