python内置了property、staticmethod、classmethod三个装饰器,有时候我们也会用到,这里简单说明下 1、property 作用:顾名思义把函数装饰成属性 一般我们调用类方法成员,都是如下写法: 这里一看square就是类的一个方法,但如果把他写成如下形式,那么就不确定 ...
分类:
编程语言 时间:
2018-08-04 20:30:54
阅读次数:
129
D题:Around Square 水题 1 #include <bits/stdc++.h> 2 3 using namespace std; 4 typedef long long ll; 5 6 int main() 7 { 8 ll n; 9 cin>>n; 10 for(int i=1;i< ...
分类:
其他好文 时间:
2018-08-04 11:48:49
阅读次数:
166
栈(Stack) 队列(Queue) 部分和问题 题目大意:给定整数a1,a2,…,an,判断是否可以从中选出若干数,使它们的和恰好为k 限制条件: 1≤n≤20 -108≤ai≤108 -108≤k≤108 题解:深度优先搜索,从a1开始按顺序决定每个数加或不加,在全部n个数都决定后在判断它们的和 ...
分类:
其他好文 时间:
2018-08-02 19:14:54
阅读次数:
177
1 // ##################################################################### 2 'use strict'; 3 let numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9]; 4 5 6 // 除去取余2... ...
分类:
其他好文 时间:
2018-07-31 15:34:28
阅读次数:
143
python画的图表不能显示中文的时候,使用下面的代码可以解决这个问题: 画曲线的代码: ...
分类:
编程语言 时间:
2018-07-30 18:07:24
阅读次数:
144
Suppose that we have a square city with straight streets. A map of a city is a square board with n rows and n columns, each representing a street or a ...
分类:
Web程序 时间:
2018-07-29 16:30:22
阅读次数:
218
LeetCode 142. Linked List Cycle II LeetCode 148. Sort List LeetCode 146. LRU Cache LeetCode 473. Matchsticks to Square LeetCode 301. Remove Invalid Pa ...
分类:
其他好文 时间:
2018-07-28 15:08:56
阅读次数:
128
Packets Description A factory produces products packed in square packets of the same height h and of the sizes 1*1, 2*2, 3*3, 4*4, 5*5, 6*6. These pro ...
分类:
其他好文 时间:
2018-07-27 19:20:32
阅读次数:
191
C. Plus and Square Root 链接:codeforces.com/group/1EzrFFyOc0/contest/716/problem/C 题型:构造 题意:起始数 x 为 2,在当前位置 i 可重复加上 i,直到 x 为 (( i + 1 )* k )^ 2 ( k = 1, ...
分类:
其他好文 时间:
2018-07-26 15:08:30
阅读次数:
146