- 博客(36)
- 收藏
- 关注
原创 马拉车算法模板
#include #include #include using namespace std;void findBMstr(string str0){ string str; str += "$#"; int n=str0.size(); for(int i = 0; i < n; i++){ str += str0[i];
2017-08-31 14:26:58 1323
原创 POJ3347 Kadj Squares(计算几何)
Kadj SquaresTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 3296 Accepted: 1307DescriptionIn this problem, you are given a sequence S1, S2, ..., Sn of
2017-08-31 14:09:59 375
原创 POJ1696 space ant(计算几何,极角排序)
Space AntTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 4656 Accepted: 2925DescriptionThe most exciting space discovery occurred at the end of the 20
2017-08-31 14:04:52 413
原创 POJ410 Intersection 计算几何
IntersectionTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 15317 Accepted: 4008DescriptionYou are to write a program that has to decide whether a giv
2017-08-31 13:37:09 316
原创 POJ066 Treasure Hunt(计算几何)
Treasure HuntTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 7387 Accepted: 3046DescriptionArcheologists from the Antiquities and Curios Museum (ACM) ha
2017-08-31 13:34:41 565
原创 POJ2653 Pick-up sticks(计算几何)
Pick-up sticksTime Limit: 3000MS Memory Limit: 65536KTotal Submissions: 13739 Accepted: 5210DescriptionStan has n sticks of various length. He throws them one a
2017-08-31 13:09:36 414
原创 POJ1556——The Doors 计算几何,最短路
The DoorsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 9012 Accepted: 3458DescriptionYou are to find the length of the shortest path through a chamb
2017-08-30 16:22:51 478
原创 POJ1269——Intersecting Lines(计算几何,直线关系判断)
Intersecting LinesTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 16680 Accepted: 7191DescriptionWe all know that a pair of distinct points on a plane
2017-08-30 16:18:48 360
原创 POJ3304 Segments(计算几何,线段和直线的交点)
SegmentsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 15325 Accepted: 4859DescriptionGiven n segments in the two dimensional space, write a progra
2017-08-30 16:11:08 389
原创 POJ2318 TOYS(叉积,计算几何)
TOYSTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 16234 Accepted: 7786DescriptionCalculate the number of toys that land in each bin of a partitioned
2017-08-30 15:59:28 287
原创 Relevant Phrases of Annihilation SPOJ - PHRASES 后缀数组
PHRASES - Relevant Phrases of Annihilationno tags You are the King of Byteland. Your agents have just intercepted a batch of encrypted enemy messages concerning the date of the planned a
2017-08-29 22:41:47 363
原创 POJ3294——Life Forms 后缀数组
Life FormsTime Limit: 5000MS Memory Limit: 65536KTotal Submissions: 15912 Accepted: 4695DescriptionYou may have wondered why most extraterrestrial life forms
2017-08-29 22:22:59 398
原创 POJ3415 Common Substrings(后缀数组,单调栈)
Common SubstringsTime Limit: 5000MS Memory Limit: 65536KTotal Submissions: 11195 Accepted: 3701DescriptionA substring of a string T is defined as:T(i, k)=
2017-08-29 21:26:51 314
原创 POJ2774 Long Long Message(后缀数组)
Long Long MessageTime Limit: 4000MS Memory Limit: 131072KTotal Submissions: 31523 Accepted: 12719Case Time Limit: 1000MSDescriptionThe little cat is major
2017-08-29 20:52:37 293
原创 POJ3693 Maximum repetition substring (后缀数组)
The repetition number of a string is defined as the maximum number R such that the string can be partitioned into R same consecutive substrings. For example, the repetition number of "ababab" is 3 and
2017-08-29 20:46:56 303
转载 SPOJ - REPEATS Repeats (后缀数组)
REPEATS - Repeatsno tags A string s is called an (k,l)-repeat if s is obtained by concatenating k>=1 times some seed string t with length l>=1. For example, the string s = abaabaabaaba
2017-08-29 20:23:18 275
原创 POJ2406——Power Strings(后缀数组)
Power StringsTime Limit: 3000MS Memory Limit: 65536KTotal Submissions: 51218 Accepted: 21386DescriptionGiven two strings a and b we define a*b to be their conca
2017-08-29 20:16:48 537
原创 SPOJ - DISUBSTR Distinct Substrings (后缀数组)
DISUBSTR - Distinct Substringsno tags Given a string, we need to find the total number of its distinct substrings.InputT- number of test cases. TEach test case consists of one st
2017-08-29 19:31:38 302
原创 HDU5493 Queue(线段树)
QueueTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1363 Accepted Submission(s): 689Problem DescriptionN people numbered f
2017-08-29 19:22:26 227
原创 HDU5492 Find a path (动态规划)
Find a pathTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1866 Accepted Submission(s): 809Problem DescriptionFrog fell into
2017-08-29 19:16:46 273
原创 HDU6096 string(字典树)
StringTime Limit: 6000/3000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 1037 Accepted Submission(s): 335Problem DescriptionBob has a dictiona
2017-08-28 20:39:28 334
原创 Gym - 101194F Mr. Panda and Fantastic Beasts (后缀数组)
题意:给出n个字符串,找到最短的字符串,要求仅为第一个字符串的子串。思路:把n个字符串用不出现的字符连接起来。其实就是枚举第一个字符串的每一个子串是否是其他字符串的后缀的前缀即可。#include#include#include #include #include using namespace std;const int MAXN=400000+10;const i
2017-08-28 19:36:16 1209
原创 HDU6078 Wavel Sequence(动态规划)
Wavel SequenceTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 728 Accepted Submission(s): 377Problem DescriptionHave you ev
2017-08-28 19:28:22 365
原创 HDU6074 Phone Call(并查集,lca)
Phone CallTime Limit: 6000/3000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 395 Accepted Submission(s): 163Problem DescriptionThere are n hou
2017-08-28 19:17:50 296
原创 POJ6071 Lazy Running(最短路)
Lazy RunningTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 1301 Accepted Submission(s): 557Problem DescriptionIn HDU, you
2017-08-28 15:50:40 232
原创 codefcodeforces 845D Driving Test(栈)
Driving Testtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputPolycarp has just attempted to pass the drivin
2017-08-28 02:23:18 609
原创 HDU6059 Kanade's trio(异或字典树)
Kanade's trioTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 1067 Accepted Submission(s): 392Problem DescriptionGive you an
2017-08-27 14:49:05 356
原创 HDU6058 Kanade's sum(链表)
Kanade's sumTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 2859 Accepted Submission(s): 1182Problem DescriptionGive you an a
2017-08-27 14:31:18 227
原创 字典树模板
#include #include #include #include #include #include #include #include using namespace std;const int MAXN=500000+10;struct trie{ int ch[MAXN<<3][30]; int val[MAXN<<3]; int sz;
2017-08-27 14:17:38 208
原创 计算几何模板——凸包
bool cmp_x(const point &a,const point &b){ if(a.x!=b.x) return a.x<b.x; return a.y<b.y;}vector ps;vector convex_hull(){ int n=(int)ps.size(); sort(ps.begin(),ps.end(),cmp_x)
2017-08-19 23:27:05 209
原创 扩展kmp模板
#include #include using namespace std;const int N = 101010;int Next[N],extand[N];void getNext(char *T){// Next[i]: 以第i位置开始的子串 与 T的公共前缀 int i,length = (int)strlen(T); Next[0] = length;
2017-08-19 22:30:36 234
原创 计算几何模板——点类以及线段类
#include#include#include#include#include#include#include #include #include #include using namespace std;const int MAXN = 5000+10;const int INF=1e9+7;const double eps=1e-8;const double pi
2017-08-16 20:21:37 862
原创 计算几何模板——点类
const double eps=1e-8;const double pi=acos(-1.0);//计算几何误差修正//输入为一个double类型的数,返回-1表示负数,1表示正数,0表示x为0int cmp(double x){ if(fabs(x)<eps) return 0; if(x>0) return 1; return -1;}/
2017-08-16 16:26:36 262
原创 后缀数组dc3模板(范围1e6而且多样例要用dc3)
#include#include#include#include#include#include#define F(x) ((x)/3+((x)%3==1?0:tb))#define G(x) ((x)<tb?(x)*3+1:((x)-tb)*3+2)using namespace std;const int MAXN = 3e6+10;const int N = MAXN;
2017-08-09 19:59:36 809
原创 后缀数组nlogn模板
int t1[maxn],t2[maxn],c[maxn]; bool cmp(int *r,int a,int b,int l) { return r[a]==r[b] &&r[l+a] == r[l+b]; } void get_sa(int str[],int sa[],int Rank[],int height[],int n,int m) {
2017-08-09 15:44:03 323
原创 codeforces 835C Star sky(二维树状数组)
C. Star skytime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe Cartesian coordinate system is set in the s
2017-08-01 01:27:31 321
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人