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 ]...
分类:
其他好文 时间:
2015-07-15 15:08:07
阅读次数:
253
问题描述Given a 2D binary matrix filled with 0's and 1's, find the largest square containing all 1's and return its area.For example, given the following ...
分类:
其他好文 时间:
2015-07-15 12:33:46
阅读次数:
92
Triangle, square, pentagonal, hexagonal, heptagonal, and octagonal numbers are all figurate (polygonal) numbers and are generated by the following formulae:
Triangle
P3,n=n(n+1)/2
1, 3,...
分类:
其他好文 时间:
2015-07-14 18:23:07
阅读次数:
83
Happy Number问题描述Write an algorithm to determine if a number is “happy”.A happy number is a number defined by the following process: Starting with any positive integer, replace the number by the sum of...
分类:
移动开发 时间:
2015-07-14 13:41:51
阅读次数:
126
Problem Description
“Swipe Bo” is a puzzle game that requires foresight and skill.
The main character of this game is a square blue tofu called Bo. We can swipe up / down / left / right to move B...
分类:
其他好文 时间:
2015-07-14 13:36:00
阅读次数:
123
Implementint sqrt(int x).Compute and return the square root ofx.public class Solution { //本题利用了牛顿迭代法:设r是f(x) = 0的根(x^2-k=f(x)),选取x0作为r初始近似值,过点(x0,f...
分类:
其他好文 时间:
2015-07-13 23:59:22
阅读次数:
371
正方形:1.square{width:100px;height:100px;background:#E57779;}长方形:1 .rectangle{ width: 200px;height: 100px; background: #E57779;}圆形:1 .circle{ width: 100p...
分类:
Web程序 时间:
2015-07-13 20:32:34
阅读次数:
137
Given an integern, generate a square matrix filled with elements from 1 ton2in spiral order.For example,Givenn=3,You should return the following matri...
分类:
其他好文 时间:
2015-07-13 11:39:59
阅读次数:
99
Sudoku
Time Limit: 2000MS
Memory Limit: 65536K
Total Submissions: 15456
Accepted: 7574
Special Judge
Description
Sudoku is a very simple task. A square table wi...
分类:
其他好文 时间:
2015-07-10 19:13:19
阅读次数:
148
DescriptionA factory produces products packed in square packets of the same height h and of the sizes 1*1, 2*2, 3*3, 4*4, 5*5, 6*6. These products are...
分类:
其他好文 时间:
2015-07-10 11:08:58
阅读次数:
138