题目描述 Since you are the best Wraith King, Nizhniy Magazin «Mir» at the centre of Vinnytsia is offering you a discount. You are given an array a a a of ...
分类:
其他好文 时间:
2020-07-19 17:51:34
阅读次数:
56
$arr = array(1,3,2,4,5,6,9,10,15,11);$len = count($arr);for($i=0;$i<$len;$i++){ for($k=$i+1;$k<$len;$k++){ if($arr[$i] > $arr[$k]){ $tmp = $arr[$k]; $ ...
分类:
编程语言 时间:
2020-07-19 17:50:21
阅读次数:
53
isset 检查一个变量是否为空 返回值:变量只要不是null 返回true,否则返回false 既:变量的值为 "" (空字符串), 0 (作为整数的0), 0.0 (作为浮点数的0), "0" (作为字符串的0), FALSE,array() (一个空数组) 不是null返回true 变量的值为 ...
分类:
Web程序 时间:
2020-07-19 16:25:59
阅读次数:
102
. 1.看以上错误 "TypeError: Cannot read property 'path' of null".说明是执行了null.path导致报错, 那么正常情况下应该是有一个数组,path是数组里面的其中一个值,但是返回的数据为null,赋值给了这个数组。 所以执行array.path时 ...
分类:
其他好文 时间:
2020-07-19 16:25:04
阅读次数:
84
广播变量object Main { def main(args: Array[String]): Unit = { val sparkConf = new SparkConf().setAppName("readMysql").setMaster("local[2]") val sparkConte ...
分类:
其他好文 时间:
2020-07-19 11:44:16
阅读次数:
62
package LeetCode_1060 /** * 1060. Missing Element in Sorted Array * (Prime) * Given a sorted array A of unique numbers, find the K-th missing number s ...
分类:
其他好文 时间:
2020-07-19 00:49:27
阅读次数:
93
题目链接:https://ac.nowcoder.com/acm/contest/5666/A 想法: 我们可以发现以下的一些规律 对于任意后缀其B数组的第一个元素一定为0,并且B数组的开头一定为01111(1的个取决于开头有多少个连续的相同字符) 【当然也可以是 00 这种情况,比如 ab 】 例 ...
分类:
其他好文 时间:
2020-07-19 00:38:09
阅读次数:
56
题目描述 有一个长为 n 的序列 a,以及一个大小为 k 的窗口。现在这个从左边开始向右滑动,每次滑动一个单位,求出每次滑动后窗口中的最大值和最小值。 例如: The array is [1,3,-1,-3,5,3,6,7]] and k=3。 输入格式 输入一共有两行,第一行有两个正整数 n,k。 ...
分类:
其他好文 时间:
2020-07-19 00:33:24
阅读次数:
74
做机器学习的时候经常用到XGB,简单记录一下 K折交叉验证也是模型常用的优化方法。一起记录。。。 K折交叉验证:类似三个臭皮匠,顶个诸葛亮。我的理解是,就是用民主投票的方式,选取票数最高的那个当结果。K折就是分成K份数据来进行。K= 5就是5折交叉验证,K= 7就是7折交叉验证,K=10就是10折。 ...
分类:
其他好文 时间:
2020-07-18 22:48:42
阅读次数:
81
数组中可以存放多个值。Bash Shell 只支持一维数组(不支持多维数组),初始化时不需要定义数组大小(与 PHP 类似)。 与大部分编程语言类似,数组元素的下标由0开始。 Shell 数组用括号来表示,元素用"空格"符号分割开,语法格式如下: array_name=(value1 ... val ...
分类:
编程语言 时间:
2020-07-18 22:46:45
阅读次数:
79