再次因为浮点数g++, c++编译器的问题WA,中间还因为reset没有改过来编译器无脑再WA了一次 这道题很适合Kruskal这种将最开始的联通森林,一点点聚合到一起成为一棵联通的最小生成树的想法,只不过,具体到这道题,是要将原先的p个森林,聚合成为s个森林,所以实现就非常简单了 #include ...
分类:
其他好文 时间:
2021-04-14 12:13:20
阅读次数:
0
强制类型转换 -指将一个类型强制转换为其他的数据类型 -类型转换是指,将其他数据类型,转换为 string number boolean 将其他类型转换为string * 方式一 调用被转换类型的toString方法,该方法不会影响原变量,会将转换的结果进行返回 但是注意null和undefined ...
分类:
Web程序 时间:
2021-04-14 12:04:24
阅读次数:
0
315. 计算右侧小于当前元素的个数 给定一个整数数组 nums,按要求返回一个新数组 counts。数组 counts 有该性质: counts[i] 的值是 nums[i] 右侧小于 nums[i] 的元素的数量。 示例: 输入:nums = [5,2,6,1] 输出:[2,1,1,0] 解释: ...
分类:
编程语言 时间:
2021-04-14 11:58:17
阅读次数:
0
vi proc1.sh #!/bin/bash #此脚本期望的参数个数argno=1 if [ $# -ne $argno ]then echo "Usage: 'basename $0' PID-number" >&2fi if [ ! -f "/proc/$1" ]then echo "Proc ...
分类:
系统相关 时间:
2021-04-14 11:51:22
阅读次数:
0
类型断言 .(type) 来实现 其中 type 对应的就是要断言的类型 接口类型断言 var num1 Number = 1 var num2 Number2 = &num1 if num3,ok := num2.(Number1);ok { fmt.Println(num3.Equal(1)) ...
分类:
其他好文 时间:
2021-04-13 12:19:31
阅读次数:
0
题目描述 A group of people are standing in a line. Each person has a distinct height. You would like to count the number of unordered pairs of people in t ...
分类:
其他好文 时间:
2021-04-13 12:06:43
阅读次数:
0
Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated. Flat is better tha ...
分类:
编程语言 时间:
2021-04-13 12:03:32
阅读次数:
0
Kruskal模板题,需要注意,这道题空间限制很严格,第一遍下意识的开了一个记录数组(因为一对节点之间允许多条路经,这里想着进行优化,不过弄巧成拙了,遇到了第一个MLE) #include <iostream> #include <algorithm> #include <queue> #inclu ...
分类:
其他好文 时间:
2021-04-13 11:44:47
阅读次数:
0
前言:JavaScript原始数据类型主要分为布尔值、数值、字符串、nul、undefined和ES6中的新类型Symbol和BigInt TypeScript中原始数据类型的应用 一、布尔值(boolean) let isDone : boolean = false ; 二、数值(number) ...
分类:
其他好文 时间:
2021-04-12 12:54:06
阅读次数:
0
/* typeScript 中的数据类型 boolean number string array tuple 元组类型 enum 枚举类型 any 任意类型 null 和 undefined void 类型 never 类型 */ let str: string = '你好' // str = 1 ...
分类:
其他好文 时间:
2021-04-12 12:40:46
阅读次数:
0