上一页 1 ··· 26 27 28 29 30 31 32 33 34 ··· 52 下一页
摘要: http://poj.org/problem?id=3286求m和n之间有0的数的个数。 把题转换为从0到x中有0的数的个数,count1(n)-count1(m-1)就是从m到n的个数。 1 #include 2 #include 3 #include 4 #include 5 #defi... 阅读全文
posted @ 2014-06-08 19:11 null1019 阅读(185) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=1095先求出n个节点数的二叉树的形态有多少种。卡特兰数f[n]=f[n-1]*(4*n-2)/(n+1);再递归求。 1 #include 2 #include 3 #include 4 #define ll long long 5 #de... 阅读全文
posted @ 2014-06-08 18:22 null1019 阅读(172) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=1724这道题我使用的是dijkstra,在处理进队列是条件是if(st2.c+c1 2 #include 3 #include 4 #include 5 #define maxn 20000 6 using namespace std; 7... 阅读全文
posted @ 2014-06-06 18:43 null1019 阅读(147) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=1699题意:给你n个长度为L的序列,求包含这几个序列的最短长度。先预处理每两个序列之间的关系,然后dfs枚举就行。 1 #include 2 #include 3 #include 4 #define maxn 500 5 using na... 阅读全文
posted @ 2014-06-02 21:26 null1019 阅读(226) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=3318矩阵A*矩阵B是否等于矩阵C 1 #include 2 #include 3 #include 4 #include 5 #define maxn 1010 6 using namespace std; 7 8 int a[max... 阅读全文
posted @ 2014-06-02 16:21 null1019 阅读(194) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=3071概率dp,dp[i][j]表示第i次比赛,第j支队伍胜出的概率。 1 #include 2 #include 3 #include 4 #define maxn 1000 5 using namespace std; 6 7 dou... 阅读全文
posted @ 2014-06-02 15:48 null1019 阅读(205) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=3070矩阵的快速幂,二分 1 #include 2 #include 3 #include 4 #define maxn 10000 5 using namespace std; 6 const int mod=10000; 7 8 in... 阅读全文
posted @ 2014-06-02 15:07 null1019 阅读(204) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=2976这道题就是从n个a[i]和b[i]中去掉k个a[i]和[i]使得.最大。 1 #include 2 #include 3 #include 4 #define maxn 20000 5 using namespace std; 6 c... 阅读全文
posted @ 2014-06-01 22:13 null1019 阅读(147) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=3101这道题就是求所有分子的最小共倍数和分母的最大公约数。 1 import java.math.BigInteger; 2 import java.util.*; 3 import java.util.Arrays; 4 public clas... 阅读全文
posted @ 2014-05-31 22:07 null1019 阅读(258) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=2891这道题的题意是:给你多个模性方程组:m mod ai=ri 求最小的m;中国剩余定理 1 #include 2 #include 3 #include 4 #define ll long long 5 using namespace ... 阅读全文
posted @ 2014-05-31 15:10 null1019 阅读(131) 评论(0) 推荐(0) 编辑
上一页 1 ··· 26 27 28 29 30 31 32 33 34 ··· 52 下一页