1.无符号数与有符号数比较 有时我们可能会遇到一些数据结构的大小的判定,比如判断两个堆(假设为heap1,heap2)中元素个数差值是否大于1 heap1.size() - heap2.size() > 1 heap1.size() > heap2.size() + 1 看似等价的两个比较的不等式, ...
分类:
其他好文 时间:
2021-03-08 13:45:25
阅读次数:
0
CF739E Gosha is hunting 奥妙重重的WQS二分 限制了每种球使用次数,然后考虑利用WQS二分,二分一个使用代价,然后进行dp,此时就没有数量的限制了。 所以这里我们需要二分里面套二分 然后有一个小细节就是必须保证每次内层二分等于的时候必须向下取,虽然向上取对b类没有影响,但是会 ...
分类:
其他好文 时间:
2021-03-08 13:45:12
阅读次数:
0
例子:在判断三角形形状的一个程序中,会出现 if-else 的多层嵌套,可利用程序的顺序执行结构重构代码,使其更可读。如果还想保证代码的安全性,可以用函数封装这段代码。 #include <stdio.h> #include <stdlib.h> #define PI 3.1415926 /* ru ...
分类:
其他好文 时间:
2021-03-08 13:44:39
阅读次数:
0
queue //STL之queue用法 //实现先进先出 #include<stdio.h> #include<queue> using namespace std; int main() { //定义 queue<int> qu; //进队 qu.push(1); qu.push(2); qu.p ...
分类:
其他好文 时间:
2021-03-08 13:44:24
阅读次数:
0
出现的问题 在做编程题的的时候,遇到了一个很奇怪的错误,出问题的代码如下: 1 #include <cstdio> 2 using namespace std; 3 4 int main() { 5 int c; 6 bool b; 7 // printf("%p %p", &c, &b); // ...
分类:
其他好文 时间:
2021-03-08 13:38:55
阅读次数:
0
配置文件 flume-taildir-logger.conf: # Name the components on this agent a1.sources = r1 a1.sinks = k1 a1.channels = c1 # Describe/configure the source a1. ...
分类:
其他好文 时间:
2021-03-08 13:38:15
阅读次数:
0
LG2147 [SDOI2008]洞穴勘测 这个题第一眼是线段树分治吧。 但是这个题和大部分板子不同的是,这里询问不是全图连通性了,是两点的连通性。其实思路没什么大区别,还是要用可撤销并查集维护连通性,把边挂到线段树上相应的时间点上。 只是我们现在的询问不同了,我们可以模仿把边挂在线段树上的方式,把 ...
分类:
其他好文 时间:
2021-03-08 13:37:41
阅读次数:
0
LG5227 [AHOI2013]连通图 线段树分治板子。这种动态图的问题看都不要看,大概率可以用线段树分治。 我们有一堆的集合,每次把这个集合的边删掉,问你每个时刻的连通性。 我们只需要把这个时刻删去的集合里的边删掉,也就是这个区间不用加这条边,按常规把边扔到线段树上,遍历一下,每个点的连通性就出 ...
分类:
其他好文 时间:
2021-03-08 13:37:10
阅读次数:
0
作用域 def test1(): print("in the test1")def test(): print("in the test") return test1 》test1 是函数test1的IP地址s = test() >运作test()结果是 in the test ,然后返回test1 ...
分类:
其他好文 时间:
2021-03-08 13:36:19
阅读次数:
0
我们假设有这样的结构: .module-wrapper( :id="`${targetSelector}`+ 'wrapper'" :style="styleStr" v-show="show" :class="{border: isDrag, operated: operated}" ref="w ...
分类:
其他好文 时间:
2021-03-08 13:36:04
阅读次数:
0
1、快速创建页面结构: mDoctype HTML: <!doctype html> <html lang="en"> <head> <meta charset="UTF-8" /> <title>Document</title> <meta name="viewport" content="wid ...
分类:
其他好文 时间:
2021-03-08 13:35:36
阅读次数:
0
changeOrigin: true,//是否允许跨越 // 获取某个时间格式的时间戳 var stringTime = "2014-07-10 10:21:12"; var timestamp2 = Date.parse(new Date(stringTime)); timestamp2 = ti ...
分类:
其他好文 时间:
2021-03-08 13:35:09
阅读次数:
0
async getHomes(item) { let temp = await http.getHome(); let type = []; this.content.push(type); this.show = type; for (var i = 0; i < temp.length; i++ ...
分类:
其他好文 时间:
2021-03-08 13:34:55
阅读次数:
0
var index=1; left.onclick=function () { index++ if (index>3) { index=0 } one.style.left=-index*800+"px" } right.onclick=function () { index-- if (inde ...
分类:
其他好文 时间:
2021-03-08 13:34:42
阅读次数:
0
//STL之MAP用法 //以往定义的数组实现了int类型向其他类型的映射 //现在想要实现其他类型向其他类型的映射 //通过map实现键值对存储 #include<stdio.h> #include<map> using namespace std; int main() { //定义 map<c ...
分类:
其他好文 时间:
2021-03-08 13:34:05
阅读次数:
0
docker swarm 环境准备 在本地搭建3台虚拟机1C2G,用于swarm集群。 ip地址 192.168.1.10,192.168.1.11,192.168.1.12. 配置yum源使用阿里云,使用xshell发送到所有session功能,一次操作3台机器 安装docker #配置yum源使 ...
分类:
其他好文 时间:
2021-03-08 13:33:34
阅读次数:
0
项目中使用的是HSSF进行写入下载操作,但是数据量过大时可能会造成OOM内存溢出异常,原因是一次性将所有信息写入到内存中。 百度了一下,知道原来poi中还有SXSSF,专门解决这个问题,另外还有个意外收货,那就是阿里的EasyExcel。 详细说明感觉自己也总结不了那么好,这个文章详细说明了POI的 ...
分类:
其他好文 时间:
2021-03-08 13:32:40
阅读次数:
0