随笔分类 - 数据结构
摘要:看错题意,白贡献了4个RE#include<stdio.h>#include<string.h>#include<stdlib.h>#include<math.h>__int64 parent[31000];__int64 total[31000];__int64 under[31000];__int64 getparent(__int64 x){ if(parent[x]==x) { return x; } __int64 t=getparent(parent[x]); under[x]+=under[parent[x]]; parent[x.
阅读全文
摘要:#include<stdio.h>#include<string.h>#include<stdlib.h>#include<math.h>#include<algorithm>int parent[30010];int total[30010];using namespace std;int getparent(int s){ if(parent[s]==s) { return s; } return parent[s]=getparent(parent[s]);}void Merge(int a,int b){ int m,n; m
阅读全文
摘要:252K 16MS#include<stdio.h>#include<string.h>#include<stdlib.h>#include<math.h>#include<algorithm>using namespace std;struct point{ double x; double y;};struct map{ point up; point down;}m[1000];struct node{ int L; int R; node *left; node *right; double len;//区间的长度 int c
阅读全文
摘要:34772K 63MS#include<stdio.h>#include<string.h>#include<stdlib.h>#include<math.h>#include<algorithm>using namespace std;struct post{ int head; int tail;}p[10010];struct node{ node *left; node *right; int L; int R; bool bcover;};node tree[1000000];int npoint;int endpoint[
阅读全文
摘要:空间8220K 时间3344MS瞻仰时间在1000ms内的神#include<stdio.h>#include<string.h>#include<stdlib.h>#include<math.h>#include<algorithm>using namespace std;struct node{ __int64 L; __int64 R; node *left; node *right; __int64 sum; __int64 inc;};__int64 ncount=0;node tree[200010];void build
阅读全文
摘要:线段树,第一次写,2516K 1829MS#include<stdio.h>#include<string.h>#include<stdlib.h>#include<math.h>#include<algorithm>using namespace std;int cow[50005];#define my_max 1000010#define my_min -1000010int resmax;int resmin;struct node{ int nmax; int nmin; int L; int R; node *left;
阅读全文

浙公网安备 33010602011771号