码迷,mamicode.com
首页 >  
搜索关键字:hdu 1394 minimum inv    ( 34217个结果
hdu 1558 Segment set
http://acm.hdu.edu.cn/showproblem.php?pid=1558先判断线段相交,然后用并查集合并。 1 #include 2 #include 3 #include 4 #define maxn 20000 5 using namespace std; 6 7 i...
分类:其他好文   时间:2014-05-16 05:18:02    阅读次数:353
HDU 3530 单调队列
Subsequence Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 3995    Accepted Submission(s): 1308 Problem Description There is a sequenc...
分类:其他好文   时间:2014-05-15 06:47:40    阅读次数:275
HDU 4059 The Boss on Mars-矩阵+容斥
错了29遍,终成正果。。。。。 根据题意,很容易的可以想到容斥。 然后的问题就是如何求 sum(n)=1^4+2^4+3^4+....+n^4; 有三种道路: 很显然:1^4+2^4+3^4+....+n^4=(n^5)/5+(n^4)/2+(n^3)/3-n/30; 则1,用java的大数去敲这个的代码。 2,用c++敲,但是用到分数取模,求逆元。 3,用c++敲,但是不用这...
分类:其他好文   时间:2014-05-15 06:36:06    阅读次数:328
hdu 4034 Graph
反向最短路...
分类:其他好文   时间:2014-05-15 06:13:38    阅读次数:256
hdu how many prime numbers 筛选法求素数
/* * hdu How many prime numbers * date 2014/5/13 * state AC */ #include #include #include using namespace std; bool isPrime(int x) { int sqr=sqrt(x*1.0); for(int i=2;i<=sqr;i++) {...
分类:其他好文   时间:2014-05-15 05:07:18    阅读次数:261
HDU4768:Flyer(二分)
Problem Description The new semester begins! Different kinds of student societies are all trying to advertise themselves, by giving flyers to the students for introducing the society. However, due ...
分类:其他好文   时间:2014-05-15 03:57:24    阅读次数:311
hdu 4635(强连通+缩点)
http://acm.hdu.edu.cn/showproblem.php?pid=4635 Strongly connected Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1381    Accepted Sub...
分类:其他好文   时间:2014-05-15 03:26:53    阅读次数:248
HDU--2846--Repository--字典树
#include #include #include #include #include #include using namespace std; struct ssss { ssss *c[26]; int n,v; }*s; void insert(char *str,int v) { int i,j,k,l; ssss *p,*q; p=...
分类:其他好文   时间:2014-05-14 15:06:54    阅读次数:357
hdu 最小公倍数
/* * hdu 最小公倍数 * date 2014/5/13 * state AC */ #include using namespace std; int gcd(int x,int y) { while(x!=y) { if(x>y)x=x-y; else y=y-x; } return x; } int main() ...
分类:其他好文   时间:2014-05-14 14:29:59    阅读次数:225
HDU 4635
http://acm.hdu.edu.cn/showproblem.php?pid=4635问:最多加多少条边,使得原图不是强连通图正向考虑有困难,不妨反向思考,既最少去掉几条边使得原图不是强连通。总边数sum=n*(n-1)时肯定是强连通,已经给了m条边,sum-=m这时把已经强连通的部分进行缩点...
分类:其他好文   时间:2014-05-14 13:37:36    阅读次数:335
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!