摘要: http://poj.org/problem?id=2777注意:a可能比b大 1 #include 2 #include 3 #include 4 #define maxn 1000010 5 using namespace std; 6 7 int T,L,O,a,b,c; 8 char ch; 9 struct node 10 { 11 int l,r,co; 12 }tree[3*maxn]; 13 bool tab[31]; 14 15 void build(int l,int r,int i) 16 { 17 tree[i].co=1;... 阅读全文
posted @ 2014-02-10 19:18 null1019 阅读(154) 评论(0) 推荐(0)
摘要: http://poj.org/problem?id=2528这个题有个细节,整个区间的长度为10000000,而n最大只有1000,所以我们要进行离散化。 1 #include 2 #include 3 #include 4 #define maxn 10010 5 using namespace std; 6 7 bool tab[maxn]; 8 int l[maxn],r[maxn],x[maxn*3],num[maxn*3],tree[maxn*12]; 9 int c,n; 10 11 int binary_search1(int sum) 12 { 13 ... 阅读全文
posted @ 2014-02-10 14:25 null1019 阅读(217) 评论(0) 推荐(0)
摘要: http://poj.org/problem?id=3422 1 #include 2 #include 3 #include 4 #include 5 #include 6 #define maxn 100000 7 using namespace std; 8 9 const int inf=1q; 34 q.push(s); 35 vis[s]=true; 36 while(!q.empty()) 37 { 38 int u=q.front();q.pop(); 39 ... 阅读全文
posted @ 2014-02-10 09:05 null1019 阅读(163) 评论(0) 推荐(0)