为什么引入抽象类? 抽象类 : 几何图形class Figure 子类: 矩形class Rectangle 圆class Circle三角形class Triangle 等... 属性: 曲边 ,直边, 几条边, 求面积, 求周长... 如果没有抽象类,父类提取出来的共性必须是唯一的,实现的,稳定 ...
分类:
其他好文 时间:
2017-11-25 14:17:05
阅读次数:
102
1.动态显示图片 可以使用 plt.ion() for.. plt.cla() plt.plot().. plt.ioff() plt.show() 2. 随机选择n个数 numpy.random.choice(a, size=None, replace=True, p=None) replace作 ...
分类:
其他好文 时间:
2017-11-25 00:49:10
阅读次数:
167
P2807 三角形计数 P2807 三角形计数 P2807 三角形计数 题目背景 三角形计数(triangle) 递推 题目描述 把大三角形的每条边n等分,将对应的等分点连接起来(连接线分别平行于三条边),这样一共会有多少三角形呢?编程来解决这个问题。 输入输出格式 输入格式: 第一行为整数t(≤1 ...
分类:
其他好文 时间:
2017-11-20 21:40:06
阅读次数:
229
题目:打印出如下图案(菱形) * *** ****** ******** ****** *** * 源码 ...
分类:
其他好文 时间:
2017-11-14 22:22:22
阅读次数:
152
设$H<G$,全体左陪集构成的集合$\overline{G}=\{gH:g\in G\}$,我们希望赋予$\overline{G}$群的结构,很自然的定义乘法为$$aH\cdot bH=abH$$容易验证此运算下有幺元$H$,以及任意的$aH\in\overline{G}$有逆元$a^{-1}H$. ...
分类:
其他好文 时间:
2017-11-14 21:20:55
阅读次数:
147
public class Solution { /* * @param triangle: a list of lists of integers * @return: An integer, minimum path sum */ public int minimumTotal(int[][] t... ...
分类:
其他好文 时间:
2017-11-13 19:48:05
阅读次数:
123
题目描述 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 t ...
分类:
其他好文 时间:
2017-11-12 17:32:24
阅读次数:
111
Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below. Bonus point if you are ab ...
分类:
其他好文 时间:
2017-11-12 12:22:13
阅读次数:
128
题目链接:https://leetcode.com/problems/pascals-triangle/description/ 题目大意:给出杨辉三角的行数,打印其杨辉三角。例子如下: 法一:直接模拟(传说这就是dp),杨辉三角的规律是:每个数都是其上两个元素的和。注意内层的list在每一次for ...
分类:
其他好文 时间:
2017-11-06 11:16:45
阅读次数:
154
题目链接:https://leetcode.com/problems/pascals-triangle-ii/description/ 题目大意:给出第几行,返回杨辉三角里的该行数据。要求空间复杂度o(k) 法一:这里用一个list数组实现,还是两层for循环,但是空间复杂度不是o(k),代码如下( ...
分类:
其他好文 时间:
2017-11-06 11:04:10
阅读次数:
153