码迷,mamicode.com
首页 >  
搜索关键字:pascals triangle    ( 1342个结果
LeetCode——Triangle
Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below. For example, given the fo ...
分类:其他好文   时间:2017-07-02 22:20:43    阅读次数:208
POJ1673 EXOCENTER OF A TRIANGLE(三角形垂心)
题目链接: http://poj.org/problem?id=1673 题目描述: EXOCENTER OF A TRIANGLE Description Given a triangle ABC, the Extriangles of ABC are constructed as follows ...
分类:其他好文   时间:2017-06-29 15:18:28    阅读次数:216
利用Python的generator打印出杨辉三角
>>> def Pascal_triangle(n=10): L=[1] while n>0: yield L L=[x+y for x,y in zip([0]+L,L+[0])] n-=1 >>> for t in Pascal_triangle(): print(t) [1] [1, 1... ...
分类:编程语言   时间:2017-06-24 00:28:18    阅读次数:321
HDU4324 Triangle LOVE【拓扑排序】
Triangle LOVE Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 2683 Accepted Submission(s): 1084 ...
分类:编程语言   时间:2017-06-23 15:29:19    阅读次数:189
EularProject 42:单词解码出来的三角形数
Coded triangle numbers Problem 42 The nth term of the sequence of triangle numbers is given by, tn = ½n(n+1); so the first ten triangle numbers are: 1 ...
分类:其他好文   时间:2017-06-22 13:26:53    阅读次数:153
数组之三种矩阵
文字描述 矩阵的压缩:对于某些特殊的矩阵来说,非零元素较少,大部分元素为0,采用某种算法,将非零元素存储在一位数组里以达到节省存储空间的目的的过程,称为矩阵的压缩 矩阵的还原:将压缩后的数组还原成原始矩阵的过程 1、对角矩阵 ①矩阵介绍 所谓对角矩阵: 矩阵中的所有非零元素都集中在以主对角线为中心的 ...
分类:编程语言   时间:2017-06-21 22:01:03    阅读次数:245
[LeetCode] Valid Triangle Number 合法的三角形个数
Given an array consists of non-negative integers, your task is to count the number of triplets chosen from the array that can make triangles if we tak ...
分类:其他好文   时间:2017-06-20 14:57:01    阅读次数:136
The Triangle
The Triangle 时间限制:1000 ms | 内存限制:65535 KB 难度:4 描写叙述 7 3 8 8 1 0 2 7 4 4 4 5 2 6 5 (Figure 1) Figure 1 shows a number triangle. Write a program that ca ...
分类:其他好文   时间:2017-06-14 10:14:00    阅读次数:220
【Lintcode】382.Triangle Count
题目: Given an array of integers, how many three numbers can be found in the array, so that we can build an triangle whose three edges length is the thr ...
分类:其他好文   时间:2017-06-13 21:48:00    阅读次数:219
【leetcode】Valid Triangle Number
题目: 解析: 首先如何判断三个边长能否组成一个三角形,这个初中数学就学过——两个小边的和大于最大边的边长。 因此,很容易得到解法,对nums数组排序后,做全排列,依次检查每种组合是否符合要求。 但是非常遗憾,这种解法的复杂度是 O(n*3),超时了。根据判定中给出的超时输入发现,nums里面很多边 ...
分类:其他好文   时间:2017-06-13 12:38:39    阅读次数:221
1342条   上一页 1 ... 39 40 41 42 43 ... 135 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!