摘要: Hdu 2665 区间K小 include using namespace std; typedef long long ll; const int maxn = 1e5+5; int arr[maxn]; int Rank[maxn]; struct ChairTree{ define lson 阅读全文
posted @ 2017-11-21 15:48 foreignbill 阅读(147) 评论(0) 推荐(0) 编辑
摘要: A include using namespace std; typedef long long ll; const int maxn = 1e6+5; const int maxm = 1e6+5; template inline void read(T &x){ x=0;T f=1;char c 阅读全文
posted @ 2017-11-20 23:02 foreignbill 阅读(113) 评论(0) 推荐(0) 编辑
摘要: Hdu 4825 从高位到地位建立字典树,贪心查询。 阅读全文
posted @ 2017-11-18 21:40 foreignbill 阅读(285) 评论(0) 推荐(0) 编辑
摘要: A Xiongnu's Land 二分答案。 include using namespace std; typedef long long ll; struct node{ int x,y,lx,ly; void in(){ scanf("%d%d%d%d",&x,&y,&lx,&ly); } ll 阅读全文
posted @ 2017-11-16 23:57 foreignbill 阅读(156) 评论(0) 推荐(0) 编辑
摘要: Color a Tree 题目大意:一棵树,根为1.某些点有一些限制。限制A: 该$x_i$点子树染色点至少$y_i$个。 限制B: 该$x_i$点子树外染色至少$y_i$个。求最少染色点数。 首先是二分答案,二分染色的点数。check就是对于这个mid能否满足要求。 令$f1[i]$表示$i$为根 阅读全文
posted @ 2017-11-16 00:08 foreignbill 阅读(503) 评论(0) 推荐(0) 编辑
摘要: A Alien Sunset 暴力枚举t E L include using namespace std; typedef long long ll; const int maxn = 1e6+5; struct node{ int x,y,h; ll d; void in(){ scanf("%d 阅读全文
posted @ 2017-11-12 18:48 foreignbill 阅读(122) 评论(0) 推荐(0) 编辑
摘要: "poj 1741" 1.选取一个点,把无根树变成有根树。通过树形dp的方式选择。用son记录点的子树大小,用F算出最大的子树,当F[x] include include include using namespace std; typedef long long ll; const int max 阅读全文
posted @ 2017-11-12 11:28 foreignbill 阅读(126) 评论(0) 推荐(0) 编辑
摘要: D F 阅读全文
posted @ 2017-11-12 00:56 foreignbill 阅读(107) 评论(0) 推荐(0) 编辑
摘要: A 珂朵莉 B 遇见 c++ include using namespace std; typedef long long ll; template inline void read(T &x){ x=0;T f=1;char ch;do{ch=getchar();if(ch==' ')f= 1;} 阅读全文
posted @ 2017-11-10 22:43 foreignbill 阅读(208) 评论(0) 推荐(0) 编辑
摘要: 凸包 POJ 1113 include include include include include include using namespace std; typedef long long ll; const double eps = 1e 9; const double PI = acos 阅读全文
posted @ 2017-11-08 22:43 foreignbill 阅读(167) 评论(0) 推荐(0) 编辑