摘要: #include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;#define CL(x,v); memset(x,v,sizeof... 阅读全文
posted @ 2017-01-15 09:41 Drinkwater_cnyali 阅读(114) 评论(0) 推荐(0) 编辑
摘要: #include#include#include#includeusing namespace std;struct T{ int l,r,f; int w,z;}a[100000+10];int root,cnt;void r_rot(int x,int y){ int t=a[y].f; a[y... 阅读全文
posted @ 2017-01-13 17:31 Drinkwater_cnyali 阅读(116) 评论(0) 推荐(0) 编辑
摘要: #include#include#include#includeusing namespace std;const int maxn=100000+10;typedef long long ll;ll a[maxn];ll tree[maxn>1; build(h>1; tree[h]+=(w-q+... 阅读全文
posted @ 2017-01-13 15:27 Drinkwater_cnyali 阅读(203) 评论(0) 推荐(0) 编辑
摘要: 当前位置:/p/1331 P1331 sdlwwlp分饼 时间: 1000ms / 空间: 131072KiB / Java类名: Main 描述sdlwwlp要和WD分一张大大大饼,奇怪的是这张饼竟然是树状的(@_@,像风铃一样),每个“节点"都像一张比较小的饼,中间用线穿了起来,形成了一张严格的... 阅读全文
posted @ 2017-01-13 11:58 Drinkwater_cnyali 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 、#include#include#include#include#include#includeusing namespace std;const int maxn = 1000000+10;int fa[maxn>>1][20],e,to[maxn],be[maxn],ne[maxn],deep... 阅读全文
posted @ 2017-01-13 11:55 Drinkwater_cnyali 阅读(122) 评论(0) 推荐(0) 编辑
摘要: #include#include#include#include#include#define maxn 500000using namespace std;int dp[1001000][20];int to[maxn*2],be[maxn*2],ne[2*maxn],e;int deep[max... 阅读全文
posted @ 2016-12-24 17:14 Drinkwater_cnyali 阅读(120) 评论(0) 推荐(0) 编辑
摘要: #include#include#include#includeusing namespace std;int heap[100000],len;void up(){ int k=len; while(k>1){ if(heap[k]>1])swap(heap[k],heap[k>>1]); k... 阅读全文
posted @ 2016-12-24 11:16 Drinkwater_cnyali 阅读(572) 评论(0) 推荐(0) 编辑
摘要: #include#include#include#includeusing namespace std;int key[10000],flag=0,root=-1;int l[10000],r[10000];void insert(int in,int x){ if(x<=key[in]){ if... 阅读全文
posted @ 2016-12-23 22:18 Drinkwater_cnyali 阅读(109) 评论(0) 推荐(0) 编辑
摘要: #include#include#include#includeusing namespace std;struct Trie{ int child[10000][26]; int val[10000]; int size; void init(){ memset(child[1],0,sizeo... 阅读全文
posted @ 2016-12-20 21:50 Drinkwater_cnyali 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 今晚花了点时间研究了这谜一般的代码。。。。#include#include#include#includeusing namespace std;const int charset=26,base='a',max_node=100000;//charset 为字符集大小//base 为字符集ASCI... 阅读全文
posted @ 2016-12-19 22:22 Drinkwater_cnyali 阅读(121) 评论(0) 推荐(0) 编辑