- 博客(7)
- 资源 (1)
- 收藏
- 关注
原创 POJ3468(线段树+lazy思想)
#include <iostream>#include <cstdio>using namespace std;__int64 total=0;__int64 A[100000];struct CNode{ int left,right; CNode *leftchild,*rightchild; __int64 sum; __int64 inc;};CNode* build(int l,int r){ CNode* root=new CNode; root->left
2013-07-16 10:59:06 614
原创 POJ1611(并查集)
#include #include #include #include using namespace std;int getpar(int* parent,int a){ if (parent[a]!=a) parent[a]=getpar(parent,parent[a]); return parent[a];}int main(){ int n,m; wh
2013-07-10 21:01:29 557
原创 POJ2524(并查集)
if (getpar(parent,a)!=getpar(parent,b)) parent[parent[b]]=getpar(parent,a);
2013-07-10 19:38:35 661
原创 POJ2352(线段树)
不知道为什么一直TLE,用了线段树的数据结构应该不会超时才对。#include #include #include #include using namespace std;struct Tree{ int left,right; Tree *leftchild,*rightchild; int sum;};Tree* build(int l,int r){ Tr
2013-07-10 09:43:17 539
原创 POJ2352(树状数组)
#include using namespace std;int c[32001]={0};int lowbit(int x){ return x&(-x);}int getsum(int x){ int total=0; while (x>0) { total+=c[x]; x-=lowbit(x); } return total;}void upd
2013-07-09 21:07:59 517
原创 POJ2777(线段树)
color为-1时表示这一段的区间内有不同的颜色,需要继续遍历其左子树和右子树。#include #include #include #include using namespace std;struct Node{ int left; int right; Node *leftchild; Node *rightchild; int color;};N
2013-07-04 15:45:42 561
原创 POJ1151(求矩阵的并面积) 离散化
#include #include #include #include using namespace std;struct rec{ double x1; double y1; double x2; double y2;};int find(double aim,double* arr,int T){ int i; for (i=0;i<=T-1;i++) {
2013-07-03 12:08:06 783
iPhone开发基础教程.pdf
2014-07-18
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人