设计思路:声明一个父类Shape并声明一个getArea()计算面积的空方法让子类Circle,Echelon,Triangle,Rectangle 继承父类的方法并根据类的不同重写getArea()方法。最后声明一个Test类实现这四个类的方法,实现时用子类赋给父类的方法实现(学以致用); 代码: ...
分类:
其他好文 时间:
2018-11-03 12:42:14
阅读次数:
257
分析 难度 易 来源 https://leetcode.com/problems/pascals-triangle-ii/ 题目 Given a non-negative index k where k ≤ 33, return the kth index row of the Pascal's t ...
分类:
其他好文 时间:
2018-11-02 13:02:18
阅读次数:
122
General Settings Light Map Resolution 光照贴图分辨率 Generate Mesh Distancde Field 生成网格距离场(一种不怎么消耗性能的阴影) http://api.unrealengine.com/CHN/Engine/Rendering/Lig ...
分类:
其他好文 时间:
2018-10-31 20:12:02
阅读次数:
1046
109. Triangle 此题还可以用DFS,记忆化搜索去做,二刷实现 1 public class Solution { 2 /** 3 * @param triangle: a list of lists of integers 4 * @return: An integer, minimum ...
分类:
其他好文 时间:
2018-10-26 22:12:33
阅读次数:
207
题意 给你三条边a,b,c问使得构成三角形,需要增加的最少长度是多少 思路 数学了啦 代码 include using namespace std; define ll long long int main(){ ios::sync_with_stdio(false); cin.tie(0); co ...
分类:
其他好文 时间:
2018-10-15 20:30:00
阅读次数:
124
要让这个三角形合法,只需满足三角形不等式即$a+b>c$,设$c=max\left\{a,b,c\right\}$,上式转化为$c<a+b$如果已经满足,不需消耗代价否则消耗$c-a-b+1$的代价 ...
分类:
其他好文 时间:
2018-10-15 17:07:50
阅读次数:
130
[TOC] "比赛链接" A.Make a triangle! 不放了。 B.Equations of Mathematical Magic 比赛结束后 D.Labyrinth(BFS) 因为BFS一般是可以保证到达一个点时代价最小,所以考虑BFS。 本题有向左和向右两个代价。显然如果上下没有格子阻 ...
分类:
其他好文 时间:
2018-10-15 14:41:47
阅读次数:
167
A Make a triangle! 题意:给定三根线段,问最少要延长多少才能拼成一个三角形。 数学题。 B Equations of Mathematical Magic 题意:求$a (a \oplus b) x=0 $的非负整数解的个数。 打表发现是$a$在二进制下$1$的数量。 C Oh T ...
分类:
其他好文 时间:
2018-10-14 21:56:54
阅读次数:
137
A triangle is a Heron’s triangle if it satisfies that the side lengths of it are consecutive integers t−1, t, t+ 1 and thatits area is an intege ...
分类:
其他好文 时间:
2018-10-14 11:40:30
阅读次数:
177
概要 在之前的教程中,我们建立了一个最小的Direct3D 11的应用程序,它用来在窗口上输出一个单一颜色。在本次教程中,我们将扩展这个应用程序,在屏幕上渲染出一个单一颜色的三角形。我们将通过设置数据机构的过程关联到三角形。 这个教程的输出结果是在窗口中央渲染出一个三角形。 资源目录 (SDK ro ...
分类:
其他好文 时间:
2018-10-06 16:33:48
阅读次数:
164