上一页 1 ··· 31 32 33 34 35 36 37 38 39 ··· 48 下一页
  2012年7月29日
摘要: http://poj.org/problem?id=3070有点水呀#include <iostream>#include <cstdio>#include <queue>#include <cstring>#include <set>using namespace std;const int N=3000;const int M=10000;int a1,a2,b1,b2;int A1,A2,B1,B2;void func1(){ int tempa1,tempa2; int tempb1,tempb2; tempa1=a1*A1+ 阅读全文
posted @ 2012-07-29 19:27 夜-> 阅读(139) 评论(0) 推荐(0) 编辑
  2012年7月28日
摘要: http://poj.org/problem?id=3150不擅长数学类的题呀网上很多此题的解题报告 都不错 但是没有注释推荐解题报告:http://www.cppblog.com/varg-vikernes/archive/2011/02/08/139804.html我的代码及其注释:#include<iostream>#include<cstring>#include<algorithm>#include<cstdio>#define LL long longusing namespace std;const int N=505;LL a[N 阅读全文
posted @ 2012-07-28 20:55 夜-> 阅读(195) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=2976通过二分 不断的移动左右边界 知道满足精度#include<iostream>#include<cstring>#include<algorithm>#include<cstdio>#define LL long longusing namespace std;const double eps=1e-4;const int N=1005;double a[N];double b[N];double c[N];bool cmp(double x,double y){ return x> 阅读全文
posted @ 2012-07-28 15:37 夜-> 阅读(159) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=2115作为一个数论白痴 遇到数论题我就有一种想死的冲动经过一个上午的奋斗 最终有一个地方还是看不懂问世间数论何物,只叫我生不如死。#include<iostream>#include<cstring>#include<algorithm>#include<cstdio>#define LL long longusing namespace std;LL exgcd(LL a,LL b,LL *x,LL *y){ if(b==0) { *x=1; *y=0; return a; } ... 阅读全文
posted @ 2012-07-28 11:13 夜-> 阅读(150) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=4318很裸的spfa#include<iostream>#include<cstdio>#include<algorithm>#include<cstring>#include<cmath>#include<map>#include<queue>#include<cmath>#define LL long longusing namespace std;const int N=50040;const double 阅读全文
posted @ 2012-07-28 07:59 夜-> 阅读(179) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=4313一遍dfs 注意值的传递就可以了#include<iostream>#include<cstdio>#include<algorithm>#include<cstring>#include<cmath>#include<map>#include<cmath>#define LL long longusing namespace std;const int N=100010;const int M=1000000000;s 阅读全文
posted @ 2012-07-28 07:56 夜-> 阅读(149) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=4310这个题 根据优先级排个序就可以了#include<iostream>#include<cstdio>#include<algorithm>#include<cstring>#include<cmath>#include<map>#include<cmath>#define LL long longusing namespace std;const int N=30;struct node{ int H,D;}mem[N] 阅读全文
posted @ 2012-07-28 07:52 夜-> 阅读(240) 评论(0) 推荐(0) 编辑
  2012年7月27日
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=4314典型的动态规划 首先要确认一点 那就是假设有一定数量的小矮人逃了出去 那么先逃出去的小矮人 身高+臂长 一定比后逃出的小矮人 身高+臂长要短 这样才能最优(这个还是看了解析才知道的)当最顶端的小矮人可以逃出去的话 他可以选择逃或者不逃 如果逃不出去就一定不逃要注意的是如果他不逃 就会对后面的小矮人逃走造成一些好的影响 由于他的身高影响(把他放在最下面)会使后面的小矮人更容易接近洞口处理就在这里 要想办法把这种好的影响记录下来。假设最 身高+臂长 最大的小矮人 i 值最大ans[i][j] 表示到第 i 阅读全文
posted @ 2012-07-27 20:58 夜-> 阅读(336) 评论(1) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=4312和 4311 的区别在于一个转换 自己还真想不出来max(|x|,|y|)等于 max(|x-y|,|x+y|)/2原来的两点 (x1,y1) (x2,y2) 转换为 (x1-y1,x1+y1) (x2-y2,x2+y2)最后记得除以2#include<iostream>#include<cstdio>#include<algorithm>#include<cstring>#include<cmath>#include<map>#i 阅读全文
posted @ 2012-07-27 17:38 夜-> 阅读(265) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=1061#include<iostream>#include<cstdio>#include<algorithm>#include<cstring>#include<cmath>#include<map>#include<queue>#include<cmath>#define LL long longusing namespace std;LL gcd(LL x,LL y){ if(x%y==0) return y; return gcd(y,x 阅读全文
posted @ 2012-07-27 11:21 夜-> 阅读(145) 评论(0) 推荐(0) 编辑
上一页 1 ··· 31 32 33 34 35 36 37 38 39 ··· 48 下一页