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 夜-> 阅读(200) 评论(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 夜-> 阅读(166) 评论(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 夜-> 阅读(157) 评论(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 夜-> 阅读(185) 评论(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 夜-> 阅读(157) 评论(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 夜-> 阅读(249) 评论(0) 推荐(0)