题意:让你找这样的一个三角形,三条边为t,t-1,t+1,并且面积为整数,最后满足t大于等于n。 n<=1e30 思路:直接推式子不会,打表找规律 f(n)=4*f(n-1)-f(n-2)(n>=3) f(1)=4 f(2)=14 队友用Java写的,再写个二分就行 ...
分类:
编程语言 时间:
2018-10-06 16:32:34
阅读次数:
140
You have a list of points in the plane. Return the area of the largest triangle that can be formed by any 3 of the points. Example: Input: points = [[ ...
分类:
其他好文 时间:
2018-10-06 14:32:55
阅读次数:
148
一、题目 1、审题 2、分析 给出一个三角形,找出从顶到底端链接的路径和最短的路径和。 二、解答 1、思路: 方法一、 采用 DP 方式,顶 > 底,确定从顶点到下一行的各个元素的最短路径和,最终返回最后一行的最小值。 方法二、 采用 DP 方式,底 --> 顶,依次确定从底到此一行的各个元素最短路 ...
分类:
其他好文 时间:
2018-10-06 12:11:18
阅读次数:
154
一、题目 1、审题 2、分析 输出杨辉三角的第 n 行,其中行号从 0 开始。 二、解答 1、思路: 方法一、 直接在一个 List 中计算杨辉三角的每一行。 采用一个 for 循环,每次循环一次就,向 List 头部添加一个元素 1,且 从下标 1 开始,每个元素值变为 val(i) + val( ...
分类:
其他好文 时间:
2018-10-05 22:36:24
阅读次数:
237
一、题目 1、审题 2、分析 输入一个整数 n, 返回杨辉三角的 n 行。 二、解答 1、思路: 方法一、 利用一次循环,直接计算杨辉三角的一行。再利用一次循环用 List 存储杨辉三角的 n 行。 方法二、 直接在一个 List 中计算杨辉三角的每一行。 ...
分类:
其他好文 时间:
2018-10-05 21:31:20
阅读次数:
170
Given a non-negative index k where k ≤ 33, return the kth index row of the Pascal's triangle. Note that the row index starts from 0. Example: 原题地址: Pa ...
分类:
编程语言 时间:
2018-10-05 17:21:25
阅读次数:
152
散点图 ① 基本散点图绘制② 散点图颜色、大小设置方法③ 不同符号的散点图 1. 基本散点图绘制 2. 散点图不同 颜色上色/散点大小 的方法 3. 不同符号的散点图 ...
分类:
编程语言 时间:
2018-10-04 09:13:27
阅读次数:
488
IBM平面几何难题:https://www.research.ibm.com/haifa/ponderthis/challenges/August1998.html We have a triangle ABC, with a point D on side AB, E, on side BC, a ...
分类:
其他好文 时间:
2018-10-03 00:31:15
阅读次数:
162
opengl中单位矩阵的产生方法:glm::mat4 trans; 单位矩阵进行旋转一定的角度比如30度:trans = glm::rotate(trans, 30.0f, glm::vec3(0.0f, 1.0f, 0.0f)); glDrawArrays(GL_TRIANGLES,0,3); 指 ...
分类:
其他好文 时间:
2018-10-02 20:25:16
阅读次数:
123
Problem Statement You are given the ints perimeter and area. Your task is to find a triangle with the following properties: The coordinates of each ve ...
分类:
其他好文 时间:
2018-10-01 14:08:20
阅读次数:
214