Given an index k, return the kth row of the Pascal's triangle.
For example, given k = 3,
Return [1,3,3,1].
Note: Could you optimize your algorithm to use only O(k) extra space?
题目大意
给定一个索引k,...
分类:
其他好文 时间:
2015-01-27 18:21:38
阅读次数:
172
题目链接:点击打开链接
又是一发 G++ WA , C++ AC.
简单题:给出基站的三围坐标及半径 。若球面距离小于 0 距离为 0 ,否则为 圆心距离减去2个半径
#include
#include
#include
#include
#include
#define INF 10000000
using namespace std;
double map[110]...
分类:
其他好文 时间:
2015-01-27 16:33:31
阅读次数:
120
Given two sorted integer arrays A and B, merge B into A as one sorted array.Note:You may assume that A has enough space (size that is greater or equal to m + n) to hold additional elements from B. The...
分类:
其他好文 时间:
2015-01-27 14:57:01
阅读次数:
149
Follow up for "Unique Paths":Now consider if some obstacles are added to the grids. How many unique paths would there be?An obstacle and empty space is marked as 1 and 0 respectively in the grid.For e...
分类:
其他好文 时间:
2015-01-27 13:28:19
阅读次数:
149
工具栏面板 先创建一个简单的面板。 import?bpy
class?View3DPanel():
????bl_space_type?=?‘VIEW_3D‘
????bl_region_type?=?‘TOOLS‘
????@classmethod
????def?poll(cls,?context):
?...
分类:
其他好文 时间:
2015-01-27 11:26:20
阅读次数:
247
题目:Sort a linked list in O(n log n)
time using constant space complexity.
思路:题目要求我们使用常数空间复杂度,时间复杂度为O(nlog(n)). 满足这个时间复杂度的有快速排序,归并排序,堆排序。插入排序时间复杂度为O(n^2). 双向链表用快排比较合适,堆排序也可用于链表,单项链表适合于归并排序。我们就用归并排序的...
分类:
编程语言 时间:
2015-01-27 11:13:51
阅读次数:
190
Determine whether an integer is a palindrome. Do this without extra space.
题目大意
判断一个int是否为回文数,不使用额外的储存空间。
难度系数:容易
实现
int getfactor(int x) {
if (x < 10)
return 1;
int facto...
分类:
其他好文 时间:
2015-01-27 11:13:47
阅读次数:
192
转载请注明出处:http://blog.csdn.net/u010019717更全的内容请看我的游戏蛮牛地址:http://www.unitymanual.com/space-uid-18602.html 这是在“Unity Editor Extension”系列的第 2 次帖子。post描述了为创建自定义inspectors面板在 Unity 编辑器的基本步骤。在该系列的下一个posts,...
分类:
编程语言 时间:
2015-01-26 22:46:32
阅读次数:
311
https://oj.leetcode.com/problems/word-break/Given a stringsand a dictionary of wordsdict, determine ifscan be segmented into a space-separated sequenc...
分类:
其他好文 时间:
2015-01-26 22:17:51
阅读次数:
173
Given a sorted array, remove the duplicates in place such that each element appear onlyonceand return the new length.Do not allocate extra space for a...
分类:
其他好文 时间:
2015-01-26 18:56:42
阅读次数:
227