Given a non-negative integer numRows, generate the first numRows of Pascal's triangle. Example: 原题地址: Pascal's Triangle 难度: Easy 题意: 杨辉三角 时间复杂度: O(n) ...
分类:
编程语言 时间:
2018-09-30 20:09:16
阅读次数:
188
传送门 [http://codeforces.com/contest/1030/problem/D] 题意 在第一象限,x,y得坐标上限是n,m,再给你个k,让你找3个整数点,使得围成面积德语(n m)/k,没有输出NO 分析 有解析几何,由3个点坐标求面积公式S=(1/2)|(x2 x1)(y3 ...
分类:
其他好文 时间:
2018-09-29 00:46:56
阅读次数:
153
参考了别人的思路:https://blog.csdn.net/qq_41608020/article/details/82827632 http://www.cnblogs.com/qywhy/p/9695344.html 首先根据皮克定理,2*m*n/k一定要是一个整数,也就是说2*m*n%k ! ...
分类:
其他好文 时间:
2018-09-25 16:37:11
阅读次数:
203
题面 题意:给你n,m,k,在你在(0,0)到(n,m)的矩形内,选3个格点(x,y都是整数),使得三角形面积为n*m/k,不能找到则输出-1 题解:由毕克定理知道,格点多边形的面积必为1/2的整数倍,所以首先n*m/k必须是1/2的整数倍,也就是2*n*m%k要等于0,不等于就输出-1 然后对于面 ...
分类:
其他好文 时间:
2018-09-24 14:44:34
阅读次数:
168
杨辉三角形: 1 1 1 1 2 1 1 3 3 1 1 4 6 4 11 5 10 10 5 1 列表生成式: [ x*x for x in range(10) if x%2 == 0] 将得到一个list [0,4,16,36,64 ] generator: g = ([x*x for x in ...
分类:
其他好文 时间:
2018-09-23 13:40:27
阅读次数:
108
题目: There are nn points on the plane, (x1,y1),(x2,y2),…,(xn,yn)(x1,y1),(x2,y2),…,(xn,yn). You need to place an isosceles triangle with two sides on th ...
分类:
其他好文 时间:
2018-09-23 13:36:09
阅读次数:
239
从下面往上 可以建立一个cache 这个点往下search过已经知道最小值了 下一次访问的时候就可以直接取值, 因为一般一个点都会被上面访问两次,如果不这样就会time limit错误 ...
分类:
其他好文 时间:
2018-09-23 00:16:34
阅读次数:
158
1 class Solution { 2 List res = new ArrayList(); 3 public List getRow(int rowIndex) { 4 helper(1, rowIndex + 1, new ArrayList(), null); 5 return res; ... ...
分类:
其他好文 时间:
2018-09-22 12:37:05
阅读次数:
152
water,给一个数n,问从1...n的数字里最少删去多少数字让剩下的数字必不可能组成三角形。 保留的数字必定是1、2、3、5、8、13、21.....这样的数字。 //#define test #include<bits/stdc++.h> using namespace std; const i ...
分类:
其他好文 时间:
2018-09-19 13:33:36
阅读次数:
169
【学到的知识点——ArrayList是一个对象】1、赋值后,赋值给他的ArrayList改变,被赋值的ArrayList跟着改变【学到的知识点——ArrayList的几种遍历方法】1、一般for循环遍历2、增强for循环遍历3、迭代器遍历【学到的知识点——ArrayList只能依次add】1、查看底 ...
分类:
其他好文 时间:
2018-09-13 12:05:59
阅读次数:
102