DescriptionYou're in space.You want to get home.There are asteroids.You don't want to hit them.InputInput to this problem will consist of a (non-empty...
分类:
其他好文 时间:
2015-01-27 21:32:29
阅读次数:
217
如果你已经成功建好了工程,运行之后你会发现是个小飞机的程序,如果我没记错的; 这个程序是spin-the-bottle:Space Edition,但是可惜的是,我们并不需要这些东西,我们需要一个干净的模板,所以,我们需要首先清理下战场,然后把我们需要用到的一些资源放进来。
打开项目导航栏,如下图中圆圈内的图标,或者点击? + 1:...
分类:
编程语言 时间:
2015-01-27 18:33:46
阅读次数:
217
题意:给你n个球 坐标 半径。球若相互覆盖或接触就算相连 让你求出最小的长度使得从任意一球出发能到达任意球;
思路:最小生成树
代码用g++交WA 用c++就A 无语。。。
#include
#include
#include
#include
#include
#include
#include
#include
#define N 110
#de...
分类:
其他好文 时间:
2015-01-27 18:33:30
阅读次数:
152
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