上一页 1 ··· 49 50 51 52 53 54 55 56 57 ··· 71 下一页
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1796这篇文章对容斥原理讲解很清楚 http://www.cppblog.com/vici/archive/2011/09/05/155103.htmlView Code 1 #include <iostream> 2 #include<cstdio> 3 #include<string.h> 4 #include<cmath> 5 #define LL long long 6 using namespace std; 7 LL sum,x[21],n; 8 i 阅读全文
posted @ 2012-10-10 17:23 _雨 阅读(210) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=1061这里解释的很详细。。http://blog.csdn.net/SwordHoly/article/details/4423543View Code 1 #include <iostream> 2 #include<cstdio> 3 #include<string.h> 4 #include<cmath> 5 #define LL long long 6 using namespace std; 7 LL k,t,d; 8 LL exgcd(LL a,LL b) 9 {10 if(b== 阅读全文
posted @ 2012-10-09 15:09 _雨 阅读(208) 评论(0) 推荐(0) 编辑
摘要: 中国剩余定理维基百科,自由的百科全书跳转到: 导航, 搜索中国剩余定理(Chinese Remainder Theorem,中国余数定理),古有“韩信点兵”、“孙子定理”、“鬼谷算”、“隔墙算”、“剪管术”、“秦王暗点兵”、“物不知数”之名,是数论中的一个重要命题。目录[隐藏]1 物不知数2 形式描述3 克罗内克符号4 近世交换环及推广5 参考书目[编辑] 物不知数在中国古代著名数学著作《孙子算经》中,有一道题目叫做“物不知数”,原文如下:有物不知其数,三三数之剩二,五五数之剩三,七七数之剩二。问物几何?即,一个整数除以三余二,除以五余三,除以七余二,求这个整数。中国数学家秦九韶于1247年做 阅读全文
posted @ 2012-10-08 10:55 _雨 阅读(1144) 评论(0) 推荐(0) 编辑
摘要: 划分树+二分枚举http://acm.hdu.edu.cn/showproblem.php?pid=4417划分树http://www.cnblogs.com/pony1993/archive/2012/07/17/2594544.html直接搬来模板 打得View Code 1 #include <iostream> 2 #include <cstdio> 3 #include <algorithm> 4 using namespace std; 5 #define N 100005 6 int a[N], as[N];//原数组,排序后数组 7 int 阅读全文
posted @ 2012-09-24 11:36 _雨 阅读(229) 评论(1) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=4282仔细想这个题的时候 不到一小时了 开始写的时候也就还剩半个小时了 实验室开始很乱 打的也很乱 交了几次CE WA TLE之后 就放弃了也是一道水题 了z为2时是完全平方 z从3开始枚举View Code 1 #include <iostream> 2 #include<cstdio> 3 #include<string.h> 4 #include<math.h> 5 using namespace std; 6 __int64 pows(int x,int 阅读全文
posted @ 2012-09-10 19:58 _雨 阅读(204) 评论(0) 推荐(0) 编辑
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=473没什么意思View Code 1 #include <iostream> 2 #include<cstdio> 3 #include<string.h> 4 using namespace std; 5 char s[31][31][31]; 6 struct node 7 { 8 int x,y,z,num; 9 }q[100001];10 阅读全文
posted @ 2012-09-07 20:34 _雨 阅读(161) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=14212A 之前在实验室写的时候排好了序 没打完 回来重打的时候忘记了排序。。View Code 1 #include <iostream> 2 #include<cstdio> 3 #include<string.h> 4 #include<algorithm> 5 #define INF 0xffffff 6 using namespace std; 7 int w[2011]; 8 __int64 dp[2011][1011]; 9 int main()1 阅读全文
posted @ 2012-09-07 11:07 _雨 阅读(155) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=2240简单题 1A 只是把结点变成了字符串 用map调下就好 数据量不大 floyd300+ms货币之间的转换 问转换完是否能获利View Code 1 #include <iostream> 2 #include<cstdio> 3 #include<string.h> 4 #include<map> 5 using namespace std; 6 double w[100][100]; 7 int main() 8 { 9 int i,j,k,n,m,kk =0 ;10 char str 阅读全文
posted @ 2012-09-06 20:22 _雨 阅读(146) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=10877A。。。。简单的递推 没考虑负数的情况 一直乱改。。View Code 1 #include <iostream> 2 #include<cstdio> 3 #include<string.h> 4 #define INF 0xfffffff 5 using namespace std; 6 long long dp[1011],a[1011]; 7 int main() 8 { 9 int i,j,k,n,m;10 while(scanf("%d&quo 阅读全文
posted @ 2012-09-05 20:50 _雨 阅读(178) 评论(2) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=11601A 破题敲了一个多小时 最长上升子序列和最长下降子序列合起来 并把路径保留下来 题中是可以打乱顺序去找的 先按W上升或S下降排下序 再按最升和最降做View Code 1 #include <iostream> 2 #include<cstdio> 3 #include<string.h> 4 #include<algorithm> 5 using namespace std; 6 struct node 7 { 8 int w,s,xu; 9 }q[1 阅读全文
posted @ 2012-09-05 20:06 _雨 阅读(248) 评论(0) 推荐(0) 编辑
上一页 1 ··· 49 50 51 52 53 54 55 56 57 ··· 71 下一页