上一页 1 ··· 21 22 23 24 25 26 27 28 29 ··· 52 下一页
摘要: 卡特兰数 递推公式:h(n)=h(n-1)*(4*n-2)/(n+1); 1 import java.math.BigInteger; 2 import java.util.Scanner; 3 4 public class Main { 5 6 public static void m... 阅读全文
posted @ 2014-08-05 10:10 null1019 阅读(165) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1732推箱子和游戏规则一样。 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 char g[10... 阅读全文
posted @ 2014-08-02 16:36 null1019 阅读(386) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1111复数除法: 1 #include 2 #include 3 #include 4 using namespace std; 5 6 int a[110]; 7 __int64 n; 8 int x1,... 阅读全文
posted @ 2014-08-01 16:37 null1019 阅读(197) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=4902题意:给你n个数,q个操作,操作有两种:1,在[L,R]区间内的数直接变为x。2,在[L,R]区间内比x大的数变成gcd(A[i],x);最后输出n个数。 1 #include 2 #include ... 阅读全文
posted @ 2014-08-01 14:26 null1019 阅读(215) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=4901dp1[i][j]是i参与,异或值为j的个数,x1[i][j]是以i位置向前到1的位置的异或值为j的个数,dp2[i][j]是i参与,&值为j的个数,x2[i][j]是以i位置向前到n的位置的&值为j的个数。... 阅读全文
posted @ 2014-07-31 20:35 null1019 阅读(198) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1104a%b=(a%b+b)%b;题意:开始给了你n, k, m,每次由+m, -m, *m, modm得到新的N,继续对N这样的操作,直到(n+1) mod k== N mod k时结束,并且打印路径 1 #in... 阅读全文
posted @ 2014-07-30 21:35 null1019 阅读(124) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1016题意:给你一个数n,让1~n数形成相邻两个数的和是个素数的环,并把环的序列输出 1 #include 2 #include 3 #include 4 #define maxn 100 5 using n... 阅读全文
posted @ 2014-07-30 18:09 null1019 阅读(158) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1114完全背包。 1 #include 2 #include 3 #include 4 #define maxn 50000 5 using namespace std; 6 const int inf=1<... 阅读全文
posted @ 2014-07-30 15:36 null1019 阅读(113) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1059 1 #include 2 #include 3 #include 4 #define maxn 2000000 5 using namespace std; 6 7 int dp[maxn]; 8 ... 阅读全文
posted @ 2014-07-30 14:39 null1019 阅读(107) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1423求最长公共递增子序列的长度。 1 #include 2 #include 3 #include 4 #define maxn 1000 5 using namespace std; 6 7 int d... 阅读全文
posted @ 2014-07-28 16:45 null1019 阅读(124) 评论(0) 推荐(0) 编辑
上一页 1 ··· 21 22 23 24 25 26 27 28 29 ··· 52 下一页