Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.For example:Given the below binary tree andsum =...
分类:
其他好文 时间:
2014-07-02 22:10:42
阅读次数:
262
随用随想,随用随记。通过实际应用掌握SQL语句。一. SQL分页1. 第一种方法:利用ID大于多少进行筛选SELECT TOP 20 *FROM dbo.WMS_StockWHERE ( Rk_SkuCode > ( SELECT MAX(Rk_SkuCode) FROM ( SELECT TOP ...
分类:
数据库 时间:
2014-07-02 21:47:36
阅读次数:
309
Given a binary tree, find the maximum path sum.The path may start and end at any node in the tree.For example:Given the below binary tree, 1 ...
分类:
其他好文 时间:
2014-07-02 21:13:05
阅读次数:
170
1089:Intervals总时间限制: 1000ms 内存限制: 65536kB描述There is given the series of n closed intervals [ai; b i], where i=1,2,...,n. The sum of those intervals ma...
分类:
其他好文 时间:
2014-07-02 20:39:31
阅读次数:
236
一般情况下是SQL语句:Select * From Users Where UserName Like 'Lin%'Select * From Users Where UserName Like 'Lin%'采用参数化SQLDECLARE @pattern VARCHAR(MAX)SET @patt...
分类:
数据库 时间:
2014-07-02 20:34:52
阅读次数:
287
题目链接:点击打开链接
溢出了半天,觉累不爱
#include
#include
using namespace std;
#define ll int
int main(){
ll Cas= 1, T; cin>>T;
while(T--){
ll n;
cin>>n;
double sum = 0, a;
double hehe = 0;
for(ll i =...
分类:
其他好文 时间:
2014-07-02 09:43:47
阅读次数:
201
766 - Sum of powers
题意:求 转化成 的各系数
思路:在wiki看了伯努利数的性质,
可以推成 。
然后B为伯努利数,有公式,
如此一来就可以去递推求出每项伯努利数了,然后在根据n去通分,求出每一项的答案,中间过程用到了分数的运算。
代码:
#include
#include
long long gcd(l...
分类:
其他好文 时间:
2014-07-02 08:46:49
阅读次数:
339
【题目】
Given n points on a 2D plane, find the maximum number of points that lie on the same straight line.
【题意】
给定一堆点,要求找出一条之前上的最大点数
【思路】
没什么好的方法,从每个点P出发,遍历所有的情况
从每个点P出发,斜率相同的点即为统一之前上的点
注意两种特殊情况:
1. 两个点重合(即为同一个点)
...
分类:
其他好文 时间:
2014-07-02 06:52:06
阅读次数:
171
测试参数:sysbench--test=/root/sysbench0.5/sysbench/tests/db/insert.lua
--mysql-table-engine=innodb--oltp-table-size=1000000
--max-requests=0--max-time=300--num-threads=16
--oltp-tables-count=10--report-interval=10
--mysql-host=10.8.8.100--mysql-port=3312--..
分类:
数据库 时间:
2014-07-02 06:44:36
阅读次数:
280
Math对象:该对象提供了大量的数学常量和数学函数。使用Math对象时,不应该使用new关键字创建对象,而应直接使用。如:Math.PI;例子:随机产生指定位数的验证码Number对象的创建:1.varnum=newNumber(object);2.varnum=Number(object);Number对象的属性:1.MAX_VALUE属性2.MIN_..
分类:
编程语言 时间:
2014-07-02 06:23:05
阅读次数:
285