码迷,mamicode.com
首页 >  
搜索关键字:numbers range    ( 16974个结果
JS数组方法(ES5、ES6)
1. arr.push() 从后面添加元素,添加一个或多个,返回值为添加完后的数组长度 1 let arr = [1,2,3,4,5] 2 console.log(arr.push(6,7)) // 7 3 console.log(arr) // [1,2,3,4,5,6,7] 2. arr.pop ...
分类:编程语言   时间:2020-02-25 12:29:49    阅读次数:268
Python __len__()、__reversed__()、__contains__()
__len__():当使用len(A)该对象时调用该方法,当没有该方法是会报错,且返回数据不为整数也会报错 class A(object): def __init__(self,num): self.num = num self.start_num = -1 def __len__(self): ' ...
分类:编程语言   时间:2020-02-25 09:55:38    阅读次数:77
求一百以内奇数偶数之和,用while 语句好像不可以
1 #求一百以内奇数之和 2 #用while语句好像不好求和? 3 n=1 4 s=0 5 while n < 101: 6 temp=n%2 7 if temp == 0: 8 pass 9 else: 10 s = s + n 11 n = n + 1 12 print(s) 13 14 15 ...
分类:其他好文   时间:2020-02-25 09:26:14    阅读次数:49
线段树(单点修改,区间求和,区间最大)
(一)线段树 1.E - Lost Cows N (2 <= N <= 8,000) cows have unique brands in the range 1..N. In a spectacular display of poor judgment, they visited the neig ...
分类:其他好文   时间:2020-02-25 00:34:58    阅读次数:174
leetcode279 Perfect Squares
1 """ 2 Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n. 3 Example 1: 4 Inp ...
分类:其他好文   时间:2020-02-25 00:00:16    阅读次数:59
std::out_of_range异常
使用C++容器类访问成员时由于使用问题可能会遇到"terminate called after throwing an instance of 'std::out_of_range'"或者"Abort message: 'terminating with uncaught exception of ...
分类:其他好文   时间:2020-02-24 20:28:20    阅读次数:85
c++98 stl-vector
```cpp #include #include #include //#include //c++ 98 static void vectorPart() { //vector 是c++98中引入的动态数组(dynamic array) //namespace std { //template> ... ...
分类:编程语言   时间:2020-02-24 20:14:20    阅读次数:95
python 求任意范围内水仙花数
python求水仙花数,任意范围内
分类:编程语言   时间:2020-02-24 18:59:23    阅读次数:208
python 中 np.arange()的使用
np.arange()函数返回一个有终点和起点的固定步长的排列,如[1,2,3,4,5],起点是1,终点是5,步长为1。参数个数情况: np.arange()函数分为一个参数,两个参数,三个参数三种情况1)一个参数时,参数值为终点,起点取默认值0,步长取默认值1。2)两个参数时,第一个参数为起点,第 ...
分类:编程语言   时间:2020-02-24 17:04:08    阅读次数:124
AGC011-E Increasing Numbers
题意 给定一个数$n$,$n≤10^{500,000}$,问$n$最少可以拆分成几个不降数的和。一个不降数是在十进制位下,从高位往低位看,每个数都不会比高位的数更小的数 做法 不降数可以拆成若干个形似$1111...111$的数相加 位数为$l$的全$1$数可以写成$\dfrac{10^{l+1} ...
分类:其他好文   时间:2020-02-24 13:09:14    阅读次数:55
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!