hdu
文章平均质量分 73
mtxxxx
qq 1149169650
邮箱:[email protected]
展开
-
hdu 1045 解题报告
Fire Net Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 8877 Accepted Submission(s): 5139 Problem Description Suppose that we hav原创 2016-02-19 20:38:28 · 636 阅读 · 2 评论 -
后缀数组(三)求给定字符串不相同的子串个数(hdu 4622 区间询问)
如果字符串是给定的,不询问区间,按照论文里写的,由于每个子串一定是某个后缀的前缀,相当于就是求后缀之间不相同前缀的个数。每次新加进来一个后缀,就是加上(n-sa[i]+1)个新前缀,但是其中有height[i]个前面已经算过了,减掉即可。 这题询问的是一个区间[l,r],一开始的思路是,对于每一个sa[i]在l到r之间的后缀,按前面那种方法计算,同时注意考虑一下lcp的右边超过了r的情况,过了样原创 2016-08-28 16:24:12 · 1531 阅读 · 0 评论 -
hdu1025
题目http://acm.hust.edu.cn/vjudge/contest/view.action?cid=119769#problem/D #include #include #include int grid[250][250]; bool vis[250][250]; int sum,r,c,flag; int mov[4][2]={{1,0},{-1,0},{0,1},{0,-原创 2016-07-06 16:52:47 · 303 阅读 · 0 评论 -
hdu3073 Lucas定理
//在求形如C(n,k)%p这样的式子时,如果p值是一个可变的素数, //而且不是特别大,就可以使用Lucas定理 #include #include #include #include using namespace std; long long pow_mod(long long a,long long i,long long p) { if(i==0)return 1%p原创 2016-07-17 16:47:03 · 409 阅读 · 0 评论 -
hdu 5673 卡特兰数,逆元
//题目网址 http://acm.hdu.edu.cn/showproblem.php?pid=5673//以下参考过网上代码 http://m.blog.csdn.net/article/details?id=51227707#include #include #include #include using namespace std; const int mod=1000000007原创 2016-07-17 15:25:42 · 337 阅读 · 0 评论 -
hdu 5672(尺取法)
#include #include #include using namespace std; int main() { int num[26],head,tail,T,k,n,cnt; long long ans;//wa一次。。 char str[1000001]; cin>>T; while(T--) { scanf("%原创 2016-04-23 16:17:51 · 433 阅读 · 0 评论 -
hdu 2063(二分匹配)
#include #include #include #include #include using namespace std; const int maxn=1002,INF=1000000000; //最大流模板 struct Edge { int from,to,cap,flow; Edge(int u,int v,int c,int f):from(u),to原创 2016-04-29 19:31:42 · 256 阅读 · 0 评论 -
hdu 1551(二分)
Cable master Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 2919 Accepted Submission(s): 1099 Problem Description Inhabitants of the Wo原创 2016-02-25 23:16:36 · 297 阅读 · 1 评论 -
hdu 1518 square
Square Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 11794 Accepted Submission(s): 3784 Problem Description Given a set of sticks of原创 2016-02-25 23:05:24 · 207 阅读 · 0 评论 -
hdu 1075
What Are You Talking About Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 102400/204800 K (Java/Others) Total Submission(s): 18607 Accepted Submission(s): 6087 Problem Description Ign原创 2016-02-24 22:59:23 · 217 阅读 · 0 评论 -
hdu 1166 敌兵布阵(线段树)
敌兵布阵 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 66198 Accepted Submission(s): 27898 Problem Description C国的死对头A国这段时间正在进行军事演习,所以C国间谍原创 2016-02-21 22:38:48 · 274 阅读 · 0 评论 -
hdu 2717 解题报告
hdu 2717 Catch That Cow Time Limit: 5000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 10630 Accepted Submission(s): 3319 Problem Description原创 2016-02-19 22:09:40 · 355 阅读 · 0 评论 -
manacher算法求最长回文子串(hdu3068)
//第一次学到这种算法,算法分析和代码实现参考了博客: http://blog.csdn.net/xingyeyongheng/article/details/9310555 很详细#include #include #include using namespace std; const int maxn=110005; char str[maxn],s[maxn*2]; int p[max原创 2016-08-28 20:46:43 · 346 阅读 · 0 评论