三角形 Triangle三条边长:a,b,c面积:(公式) S = sqrt ( p * (p-a) * (p-b) * (p-c) )其中, p = (a + b + c) /2 即周长的一半 sqrt : 求平方根 直角三角形 RightTriangle直角三角形的面积比较容易求得: a * b ...
分类:
编程语言 时间:
2018-11-28 15:36:48
阅读次数:
148
1. Question: 611. Valid Triangle Number https://leetcode.com/problems/valid-triangle-number/ Given an array consists of non-negative integers, your ta ...
分类:
其他好文 时间:
2018-11-22 23:57:15
阅读次数:
305
"嘟嘟嘟" 题意:给一堆点,求其中三个点构成的三角形的最大面积。 刚开始不知咋的忘了三角形三条边可能都不在凸包上,然后快速的打了个旋转卡壳结果$WA$了。还是自己太年轻了…… 正解也是旋转卡壳。对于三角形三个点$i, j, k$,$k, j, i$挨个旋转就行啦。 c++ include inclu ...
分类:
其他好文 时间:
2018-11-22 20:57:57
阅读次数:
180
题目大意: 给出三角形的三个顶点 再给一条绳(绳长不超过三角形周长) 求绳子在三角形中能围出的最大面积 题解链接 http://blog.sina.com.cn/s/blog_6a46cc3f0100tujn.html 多边形和圆 周长相同时 圆的面积更大 而当绳长超过三角形的内接圆时 沿着边放 对 ...
分类:
其他好文 时间:
2018-11-20 01:17:29
阅读次数:
183
给定一个三角形,找出自顶向下的最小路径和。每一步只能移动到下一行中相邻的结点上。 例如,给定三角形: 自顶向下的最小路径和为 11(即,2 + 3 + 5 + 1 = 11)。 说明: 如果你可以只使用 O(n) 的额外空间(n 为三角形的总行数)来解决这个问题,那么你的算法会很加分。 逆向思维,从 ...
分类:
其他好文 时间:
2018-11-14 01:04:07
阅读次数:
165
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 ...
分类:
其他好文 时间:
2018-11-11 01:02:02
阅读次数:
198
https://leetcode.com/problems/pascals-triangle-ii/description/ Given a non-negative index k where k ≤ 33, return the kth index row of the Pascal's tri ...
分类:
其他好文 时间:
2018-11-10 12:53:57
阅读次数:
182
题目: Given numRows, generate the first numRows of Pascal's triangle. For example, given numRows = 5, Return [ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4, ...
分类:
其他好文 时间:
2018-11-09 16:01:31
阅读次数:
179
入门篇:动态规划思想 动态规划向来都是OI竞赛生涯中的分水岭。 开篇杂谈 _ 文章中有任何地方不懂可联系我$qq:2832853025$,~~退役前全天在线。~~ _ 前置技能 1. DFS搜索。 2. 记忆化搜索。 3. 递推式。(高中必修五数学) 个人理解 照搬定义肯定不是传授知识的好办法,呢只 ...
分类:
其他好文 时间:
2018-11-07 11:32:37
阅读次数:
180
RT,从11.5号开始写。。。 飞行棋 傻逼题,数据范围给到$n^4$都可以过。 跳房子 老师早就料到我们没有看这道题。。。于是大胆考原题。 二分+$n^2$的$DP$,然后发现可以用单调队列优化到$O(nlogn)$。 压力 点双缩点然后差分,最后统计$dfs$子树和即可。 ...
分类:
其他好文 时间:
2018-11-06 17:39:59
阅读次数:
123