博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

04 2012 档案

摘要:题目:http://acm.hdu.edu.cn/showproblem.php?pid=2993一个细节没注意,导致WA了无数遍,不过也让我对斜率优化有了更深的认识,要维护“队列里”的数据的凸性。View Code #include <iostream>#include <stdio.h>#include <string.h>#include <algorithm>using namespace std;const int N = 100000+10;int n, m, l, r, k;int q[N];double a[N];char ch 阅读全文

posted @ 2012-04-30 22:45 紫华弦筝 阅读(254) 评论(0) 推荐(0)

摘要:题目:http://poj.org/problem?id=2553题意:一张有向图G,G图中从v可达的所有点w,也都可以达到v,这样的v称为sink。按照大小全部输出,没有输出空行。方法:tarjanView Code #include <stdio.h>#include <string.h>#include <math.h>#include <algorithm>#define Max(A,B) ((A)>(B)?(A):(B))#define Min(A,B) ((A)<(B)?(A):(B))#define clr(a,b) m 阅读全文

posted @ 2012-04-06 15:47 紫华弦筝 阅读(119) 评论(0) 推荐(0)

摘要:题目:http://poj.org/problem?id=2186题意:给一张有向图,求一些点的个数,这些点满足其他所有点都能直接或间接指向它。方法:tarjan+缩点View Code #include <stdio.h>#include <string.h>#include <math.h>#include <algorithm>#define Max(A,B) ((A)>(B)?(A):(B))#define Min(A,B) ((A)<(B)?(A):(B))#define clr(a,b) memset(a, b, size 阅读全文

posted @ 2012-04-06 14:34 紫华弦筝 阅读(107) 评论(0) 推荐(0)