原地踏步了半年,感觉一切都陌生了~题意:a[i]-一个任意的数,这个数要等于a[1]~a[i-1]每个数减去任意一个数,经过多次这样的变换到达目标b序列,能到达就yes不能到达距no.一开始各种分析,所有的差的和必须是偶数,sum(cha[1~i-1])>=cha[i](其中cha[i]=a[i]-...
分类:
其他好文 时间:
2014-05-26 07:09:20
阅读次数:
231
2014 百度之星资格赛,xor sum ,显然是要建一棵0、1树 其实很简单就是二叉树,只不过为了操作简便,即程序的速度,所以就采用静态树,即不动态分配内存,使用较大的全局数组。...
分类:
其他好文 时间:
2014-05-26 05:47:20
阅读次数:
220
总结一下我遇到的问题:
1.设置最小分词长度分词
被搜索名字为:andy
这时搜索andy正常,但是搜索a就搜不到。
解决办法,在索引配置文件中的index中添加
min_infix_len = 1
2.调用API返回记录总是只有20条
因为coreseek它默认返回的result里面,function SetLimits ( $offset, $limit, $max_...
分类:
其他好文 时间:
2014-05-26 05:32:58
阅读次数:
266
#include
#include
#include
using namespace std;
const int m=(int)1E8;
string s1,s2;
int f[2][5001]={0},g[2][5001]={0};
void init();
void work();
int my_max(int,int);
int main()
{
freopen("lcs.in","r"...
分类:
其他好文 时间:
2014-05-26 04:07:17
阅读次数:
305
题目一:
Given a binary tree containing digits from 0-9 only, each root-to-leaf
path could represent a number.
An example is the root-to-leaf path 1->2->3 which represents the number 123.
Fin...
分类:
其他好文 时间:
2014-05-26 04:06:41
阅读次数:
248
Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input would have
exact...
分类:
其他好文 时间:
2014-05-25 00:46:51
阅读次数:
229
【题目】
Find the contiguous subarray within an array (containing at least one number) which has the largest sum.
For example, given the array [?2,1,?3,4,?1,2,1,?5,4],
the contiguous subarray [4,?1,2,1] has the largest sum = 6.
【题意】
给定一个数组,找出和最大的子数组,返回...
分类:
其他好文 时间:
2014-05-24 22:19:17
阅读次数:
260
Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume
that each input would have exact...
分类:
其他好文 时间:
2014-05-24 20:43:37
阅读次数:
341
http://poj.org/problem?id=3013
题意:
Because of a technical difficulty, price of an edge will be (sum of weights of all descendant nodes) × (unit price of the edge).这句话一直没看懂。后面还以为是最小生成树。
正确...
分类:
其他好文 时间:
2014-05-24 20:27:13
阅读次数:
266
在Mongodb的查询中,有类似于SQL中group
by功能的group函数.两者的功能有些类似,但是区别也是比较明显的.对于SQL来说,group
by的作用就是安装依据列来将数据表中的记录分成一个个的组,而查询结果中,只能Select出来Group BY中含有的列,或者使用了聚合函数(sum,...
分类:
数据库 时间:
2014-05-24 09:20:01
阅读次数:
251