码迷,mamicode.com
首页 >  
搜索关键字:square    ( 2122个结果
POJ 1730 Perfect Pth Powers (枚举||分解质因子)
Perfect Pth PowersTime Limit:1000MSMemory Limit:10000KTotal Submissions:16638Accepted:3771DescriptionWe say that x is a perfect square if, for some in...
分类:其他好文   时间:2014-08-20 12:14:12    阅读次数:380
LA 4728 Square ,旋转卡壳法求多边形的直径
给出一些正方形,让你求这些正方形顶点之间的最大距离的平方。 //返回点集直径的平方 int diameter2(vector & points) { vector p = ConvexHull(points); int n = p.size(); if(n==1) return 0; if(n==2) return Dist2(p[0], p[1]...
分类:其他好文   时间:2014-08-20 02:42:15    阅读次数:165
SICP 1.21 1.22 1.23 1.24
解:相关代码如下,时间测不出来 #lang?racket (define?(square?x) ??(*?x?x)) (define?(smallest-divisor?n) ??(define?(divides??a?b) ????(=?(remainder?b?a)?0)) ??(define?(next...
分类:其他好文   时间:2014-08-17 18:43:12    阅读次数:187
POJ2002:Squares
Description A square is a 4-sided polygon whose sides have equal length and adjacent sides form 90-degree angles. It is also a polygon such that rotating about its centre by 90 degrees gives the sa...
分类:其他好文   时间:2014-08-17 15:39:02    阅读次数:286
Square spiral
Square spiralNikola picks up a strange circuit board. All of its elements are connected in a spiral and it is possible to connect the neighboring elem...
分类:其他好文   时间:2014-08-17 09:09:51    阅读次数:411
UVA - 12295 Optimal Symmetric Paths (递推)
Description   Optimal Symmetric Paths  You have a grid of n rows and n columns. Each of the unit squares contains a non-zero digit. You walk from the top-left square to the b...
分类:其他好文   时间:2014-08-16 12:36:50    阅读次数:332
每日算法之四十一:Spiral Matrix II (螺旋矩阵)
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
【HackerRank】Encryption
One classic method for composing secret messages is called a square code. The spaces are removed from the english textand the characters are written i...
分类:其他好文   时间:2014-08-14 20:03:09    阅读次数:276
【Leetcode长征系列】Sqrt(x)
原题: Implement int sqrt(int x). Compute and return the square root of x. ==============================以下为引用==================================== 牛顿迭代法    为了方便理解,就先以本题为例:    计算x2 = n的解,令f(...
分类:其他好文   时间:2014-08-14 16:51:18    阅读次数:263
poj 1979 && zoj 2165 Red and Black
Red and BlackTime Limit:1000MSMemory Limit:30000KTotal Submissions:22409Accepted:12100DescriptionThere is a rectangular room, covered with square tile...
分类:其他好文   时间:2014-08-13 22:04:17    阅读次数:266
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!