04 2012 档案
sdut 2401 最大矩阵面积
摘要:http://acm.sdut.edu.cn/sdutoj/problem.php?action=showproblem&problemid=2401#include <iostream>#include <cstdio>#include <algorithm>using namespace std;const int N=1010;struct node{ int x,y;}mem[N];bool cmp(node a,node b){ if(a.x==b.x) return a.y<b.y; return a.x<b.x;}bool 阅读全文
posted @ 2012-04-23 20:10 夜-> 阅读(176) 评论(0) 推荐(0) 编辑
hdu 1054 Strategic Game
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1054树形DP 主要是把思路屡清楚选个根结点进行向下搜 每个点都有两种可能 放士兵还是不放防止重复搜索就可以#include<iostream>#include<string>#include<string.h>#include<queue>#include<math.h>#include<stdio.h>#include<algorithm>#include<map>using namespace std;con 阅读全文
posted @ 2012-04-22 20:22 夜-> 阅读(145) 评论(0) 推荐(0) 编辑
poj 2151 Check the difficulty of problems
摘要:http://poj.org/problem?id=2151dp不是问题 问题在于这是道数学题 亲人呀 最恨数学题尤其是和概率有关 代码很乱呀 有木有#include<iostream>#include<string>#include<string.h>#include<queue>#include<math.h>#include<stdio.h>#include<map>using namespace std;double probability[1005][35];double a[35][35];doub 阅读全文
posted @ 2012-04-20 21:12 夜-> 阅读(171) 评论(0) 推荐(0) 编辑
poj 3274 Gold Balanced Lineup
摘要:http://poj.org/problem?id=3274不得不说自己的哈希水平很烂 此题完全抄了别人的代码,看来以后要看看哈希呀先贴代码日后消化#include<iostream>#include<string>#include<string.h>#include<queue>#include<math.h>#include<stdio.h>#include<map>using namespace std;const int N=100010;const int prime=99983;int n,k;in 阅读全文
posted @ 2012-04-19 16:44 夜-> 阅读(162) 评论(0) 推荐(0) 编辑
poj 3414 Pots
摘要:http://poj.org/problem?id=3414会的题一定要细心此题只有一组测试数据如果你按多组来 加上while(scanf("%d%d%d",&A,&B,&C)!=EOF)多组输入的语句 他会给你个Output Limit Exceeded#include<iostream>#include<string>#include<string.h>#include<queue>#include<stdio.h>#include<map>using namespace s 阅读全文
posted @ 2012-04-16 21:50 夜-> 阅读(208) 评论(0) 推荐(0) 编辑
poj 3083 Children of the Candy Corn
摘要:http://poj.org/problem?id=3083题目不难 主要是繁琐#include<iostream>#include<stdio.h>#include<string.h>#include<string>#include<queue>#include<algorithm>#include<map>using namespace std;const int N=50;int x[4]={0,-1,0,1};int y[4]={-1,0,1,0};int LL[4]={-1,0,1,2};int RR 阅读全文
posted @ 2012-04-13 21:58 夜-> 阅读(146) 评论(0) 推荐(0) 编辑
poj Finicky Grazers 3184
摘要:http://poj.org/problem?id=3184动态规划 加各种优化二维数组太大 需要用滚动数组题目大意: 给你N头牛 和(0--L)L+1个位置 在满足牛之间距离最大化的前提下移动牛花费时间最少首先第一头牛必须在 0 这个位置 第N 头牛必须在 L 这个位置D=L/(N-1);如果L%(N-1) 余数不为 0时 存在 D+1本题关键在于 每头牛所在位置 都有一定的范围用函数 findlr(int i,int &l,int &r)求范围 i代表第几头牛 l和r分别为左右边界其他详情见代码注释#include<iostream>#include<st 阅读全文
posted @ 2012-04-08 10:01 夜-> 阅读(268) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示