Compared with I version, the tree could be incomplete. The only difference is that, we connect current node's child to next non-childrenless' node's f...
分类:
其他好文 时间:
2014-07-26 17:02:11
阅读次数:
316
POJ3274问题重述:已知有n头牛,用一个K位二进制数Ak,Ak-1,...,A1表示一头牛具有的特征,Ai=1表示具有特征i。现给定按顺序排列的N头牛的k位特征值,称某个连续范围内“特征平衡”,假如在这个范围内,拥有各个特征的牛的数量都相等。求最大“特征平衡”连续范围。分析:用sum[i][j]...
分类:
其他好文 时间:
2014-07-26 17:00:01
阅读次数:
354
Leetcode Combination Sum II,略有疑惑求讨论...
分类:
其他好文 时间:
2014-07-26 15:30:12
阅读次数:
155
Problem Description:
Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers
sums to T.
Each number in C may only b...
分类:
其他好文 时间:
2014-07-26 15:24:02
阅读次数:
252
# include
# include
# include
# include
# define N 100005
using namespace std;
vectorg[N];
int node[N];
int slove(int x)
{
int sum=0,i;
for(i=0;i<g[x].size();i++)
{
sum+=node[g[x][i]];
}
re...
分类:
其他好文 时间:
2014-07-26 15:21:40
阅读次数:
224
题意:给一个字符串(#include #include #include #include #include #define ll long longusing namespace std;int Maxn, N ;int sum[1005];struct BlockList{ int siz...
分类:
其他好文 时间:
2014-07-26 14:58:11
阅读次数:
244
http://www.lydsy.com/JudgeOnline/problem.php?id=1012树状数组原来我只懂得sum和add的操作,今天才知道可以有求区间最值的操作,我学习了一下写了个,1a了。区间最值其实和区间求和差不多,就是将sum数组的含义转移到max,然后通过特定的区间更新ma...
分类:
Web程序 时间:
2014-07-26 14:37:50
阅读次数:
251
375.Query on a tree 【QTREE】 有两个操作: (1)修改第i条边的边权 (2)询问a到b路径上的边权最大值。 树链剖分入门题。树链剖分+线段树维护最大值。修改/查询均为O(log^2)。 很懒,没有写。913.Query on a tree II 【QTREE2...
分类:
其他好文 时间:
2014-07-26 13:53:45
阅读次数:
569
就是练个手,白皮书的小东西。原题是要写N!/(M!*(N-M)!)他是先写F(n)的N!然后F(N)/(F(M)*F(N-M))但是这样会溢出。改一下,主要是习惯MAIN()外写函数然后调用#includeint f(int n,int m){int i,sum=1;for(i=n-m;i>0;i+...
分类:
其他好文 时间:
2014-07-26 13:48:55
阅读次数:
224
1557. Can you answer these queries IIProblem code: GSS2Being a completist and a simplist, kid Yang Zhe cannot solve but get Wrong Answer from most of....
分类:
其他好文 时间:
2014-07-26 05:44:27
阅读次数:
377