Given an integer n, generate a square matrix filled with elements from 1 to n2 in
spiral order.
For example,
Given n = 3,
You should return the following matrix:
[
[ 1, 2, 3 ],
[ 8, 9, 4 ],
[...
分类:
其他好文 时间:
2014-08-15 22:37:39
阅读次数:
274
Given a collection of integers that might contain duplicates,S, return all possible subsets.Note:Elements in a subset must be in non-descending order....
分类:
其他好文 时间:
2014-08-15 21:08:29
阅读次数:
212
湫湫系列故事——减肥记II
Time Limit: 5000/2000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)
Total Submission(s): 2395 Accepted Submission(s): 1018
Problem Description
虽然制定了减肥食谱,...
分类:
其他好文 时间:
2014-08-15 19:42:59
阅读次数:
255
Given a set of distinct integers, S, return all possible subsets.Note:Elements in a subset must be in non-descending order.The solution set must not c...
分类:
其他好文 时间:
2014-08-15 17:18:39
阅读次数:
177
原题:
Given an array of integers, every element appears three times except for one. Find that single one.
Note:
Your algorithm should have a linear runtime complexity. Could you implement it withou...
分类:
其他好文 时间:
2014-08-15 14:46:48
阅读次数:
207
一个出栈有多少种顺序的问题。一般都知道是Catalan数了。
问题是这个Catalan数很大,故此需要使用高精度计算。
而且打表会速度快很多,打表公式要熟记:
Catalan数公式 Cn=C(2n,n) / (n+1);
递推公式 C(n ) = C(n-1)*(4*n-2) / (n+1)
高精度乘以一个整数和高精度除以一个整数的知识,这样还是使用整数数组比较好计算,如果使用str...
分类:
其他好文 时间:
2014-08-15 12:57:58
阅读次数:
263
Given a collection of integers that might contain duplicates, S, return all possible subsets....
分类:
其他好文 时间:
2014-08-14 20:42:59
阅读次数:
196
由树莓派引发的卡片电脑热潮,国内嵌入式开发商也纷纷开发体积小的卡片电脑。国内著名嵌入式开发商天嵌科技与飞凌嵌入式也开发卡片电脑。现在,将对天嵌的E8卡片式电脑与飞凌的OK335xS-II开发板进行基本参数的对比。
分类:
其他好文 时间:
2014-08-14 13:32:08
阅读次数:
223
在C++中单个类的初始化比较简单就略过不说。
当一个类继承了另外一个类,或者是一个类中还存在一个类
class A{
、、、
};
class B
{
、、、
};
class C:classA{
private:
B bb;
int x
public:
C(int ii):B(ii),bb(ii) ,x(ii){};
};
此时我们进...
分类:
编程语言 时间:
2014-08-13 22:27:47
阅读次数:
243
3081 题意:
n个女孩选择没有与自己吵过架的男孩有连边(自己的朋友也算,并查集处理),2分图,有些边,求有几种完美匹配(每次匹配每个点都不重复匹配)
我是建二分图后,每次增广一单位,(一次完美匹配),再修改起点还有终点的边流量,继续增广,直到达不到完美匹配为止。网上很多是用二分做的,我觉得没必要。。。(网上传播跟风真严重。。。很多人都不是真正懂最大流算法的。。。)
3277 ...
分类:
其他好文 时间:
2014-08-13 22:24:47
阅读次数:
447