Given an array of integers and an integer k, you need to find the number of unique k-diff pairs in the array. Here a k-diff pair is defined as an inte ...
分类:
其他好文 时间:
2019-05-11 09:41:02
阅读次数:
132
题目链接:https://ac.nowcoder.com/acm/contest/625/B 解法:这题其实就是求2^18个点内最近的两个点的距离。我们可以容易想到朴素解法:把每个点作为源点跑最短路取最小值。也很容易想到这个做法严重超时。 对于这种构图,这里有一个比较套路的方法:枚举2进制位数k,按 ...
分类:
其他好文 时间:
2019-05-10 23:47:40
阅读次数:
164
在 File - settings - Editor - General- Smart Keys - Enter 去掉 Insert pair '}' 的对勾就可以了 ...
分类:
其他好文 时间:
2019-05-10 13:23:57
阅读次数:
661
MA684 Final ProjectSpring 2019This is an individual project—please do your own work. Some discussion with other students aroundcomputer work for the p ...
分类:
其他好文 时间:
2019-05-09 19:52:59
阅读次数:
98
大意: 给定$n$元素序列, 两个人从两端轮流拿数, 每一步假设对手上次取k, 那么只能取k或k+1, 先手第一步取1或2, 直到不能拿时停止. 先手要最大化两人数字和的差, 后手要最小化, 求最后差是多少. 显然状态数是$O(n^2)$的, 直接暴力DP ...
分类:
其他好文 时间:
2019-05-06 19:09:54
阅读次数:
104
[SPOJ DQUERY]D query 题面 Given a sequence of n numbers a1, a2, ..., an and a number of d queries. A d query is a pair (i, j) (1 ≤ i ≤ j ≤ n). For each ...
分类:
其他好文 时间:
2019-05-06 16:09:53
阅读次数:
143
以前传递数据都是使用Intent进行传递,但是intent是跳转,我们这个是动态替换 所以刚开始也是一脸懵逼,百度也百度不到,就自己慢慢摸索出来了: 话不多说,直接上代码:(主要核心代码加粗) ...
分类:
移动开发 时间:
2019-05-06 11:51:05
阅读次数:
173
1 #define mm(a) memset(a,0,sizeof(a)); 2 #define max(x,y) (x)>(y)?(x):(y) 3 #define min(x,y) (x)=(a);i--) 7 #include 8 typedef long long ll; 9 #define... ...
分类:
移动开发 时间:
2019-05-05 19:29:35
阅读次数:
164
docker和kvm都是虚拟化技术,docker属于秒级启动的轻量高性能的虚拟化,它们的主要差别: 一:docker与VM区别 VM(VMware)在宿主机器、宿主机器操作系统的基础上创建虚拟层、虚拟化的操作系统、虚拟化的仓库,然后再安装应用;Container(Docker容器),在宿主机器、宿主 ...
分类:
其他好文 时间:
2019-05-05 01:15:11
阅读次数:
167
五一 DAY 6 TypeName 类型名 VariableName 变量名 函数库:# include < utility > Pair 定义一个变量,它有两个元素 :pair.first pair.scecond, 这两个元素的类型可以不同 (类似于结构体) 函数库:#include < str ...
分类:
其他好文 时间:
2019-05-03 14:32:02
阅读次数:
132