Given an arraySofnintegers, are there
elementsa,b,c, anddinSsuch thata+b+c+d= target? Find all unique quadruplets in
the array which gives the sum of ...
分类:
其他好文 时间:
2014-06-04 22:44:27
阅读次数:
250
1.select sum(CASE WHEN A.[STATUS]=0 THEN 1 ELSE
0 end) as a1,sum(CASE A.[STATUS] WHEN 1 THEN 1 ELSE 0 end) as a2,sum(CASE
A.[STATUS] WHEN 2 THEN 1 ELS...
分类:
数据库 时间:
2014-06-04 21:10:46
阅读次数:
513
Given amxngrid filled with non-negative
numbers, find a path from top left to bottom right whichminimizesthe sum of all
numbers along its path.Note:Yo...
分类:
其他好文 时间:
2014-06-04 20:57:08
阅读次数:
360
简单深搜,可以完全暴力,不会超时的。#include#include#includeusing
namespace std;#define MAX(a,b) (a>b?a:b) char maze[10][10];int n, maxn;void
DFS(int step,int count);in...
分类:
Web程序 时间:
2014-06-04 20:43:04
阅读次数:
270
--聚合函数:返回一个值,对表中所有行进行统计,忽略NULL值--sum:求和(只能数字类型)select
sum(age) from stuInfo--avg:平均值(只能数字类型)select avg(age) from
stuInfo--max:最大值(只能数字类型或者是字符串)select ...
分类:
数据库 时间:
2014-05-30 02:49:16
阅读次数:
289
本文希望通过简单的总结,把常用的查询方法予以总结,希望能够明确在心主要涵盖:模糊查询、排序、分组、集合函数、TOP、Case包括:Between、In、Like、And、Or、Order
by包括:Group by、Distinct、MAX\MIN、Avg、Count、Sum、Having、Top、...
分类:
数据库 时间:
2014-05-29 23:13:46
阅读次数:
456
堆排序算法使用二叉堆实现排序,树上的每一个节点对应数组中的一个元素。第一步:使用MAX_HEAPIFY维护一个最大堆(所有孩子节点都必须小于或等于其父节点)。它的输入为一个数组A和一下标i,调用MAX_HEAPIFY时,假设节点i的左右子树都是最大堆。伪码:
1 LEFT(i) 2 return.....
分类:
其他好文 时间:
2014-05-29 21:35:08
阅读次数:
364
题意大概是给出一个数列num,和一个目标数target,然后要找出数列中的两个数,使得这两个数之和等于目标数,输出这两个数的下标值(从1开始算)。
一个比较暴力的方法是用一个二重循环直接遍历序列,在第一重循环中找到a,在第二重循环中找到b,使得a+b=target,这种做法的时间复杂度是O(n^2....
分类:
其他好文 时间:
2014-05-29 21:01:06
阅读次数:
307
题意:computing a max-spacingk-clustering.spacing 是指两个
cluster 之间的最小距离输入:[number_of_nodes][edge 1 node 1] [edge 1 node 2] [edge 1
cost][edge 2 node 1] [e...
分类:
其他好文 时间:
2014-05-29 20:40:30
阅读次数:
323
一开始始终找不到网上说得create_project.py,所以网上通过这个的方法行不通。所以就找了点关于3.0的资料,貌似在3.0正式版里是通过**/cocos2d-x-3.0/tools/cocos2d-console/bin/cocos.py来创建工程的。不过3.0正式版要先搞定环境变量。。1...
分类:
其他好文 时间:
2014-05-29 15:35:18
阅读次数:
338