题目大意: 题目思路: 最朴素的方法就是暴力枚举两个答案,然后check取一个最大值就ok,时间复杂度O(N^2) 考虑一种比较好的做法 最小值最大化老二分的套路了 我们二分答案 考虑如何check 因为我们二分的mid是最小值,也就是小于这个值的数字,我们一定是用不到的 也就是如果剩下的数字中能够 ...
分类:
其他好文 时间:
2021-04-21 12:04:21
阅读次数:
0
该模式的作用就是复制对象,特别是复杂的对象。 1.浅克隆 两个要点:实现Cloneable接口,重写clone()方法 public class Product implements Cloneable{ private String name; private Date date; public ...
分类:
其他好文 时间:
2021-04-20 15:18:21
阅读次数:
0
PS:本文主要包括二叉树的前序,中序,后序,层序,垂序遍历,使用cpp语言。 前序遍历 struct TreeNode { int val; TreeNode* left; TreeNode* right; TreeNode(int x) : val(x), left(NULL), right(NU ...
分类:
其他好文 时间:
2021-04-20 15:06:15
阅读次数:
0
解决问题-》有的放矢 1.spark 报错 Initial job has not accepted any resources; check your cluster UI to ensure that workers are registered and have sufficient reso ...
分类:
其他好文 时间:
2021-04-19 15:56:23
阅读次数:
0
1 #include<iostream> 2 #include<string> 3 #include<vector> 4 #include<algorithm> 5 using namespace std; 6 7 void test01() 8 { 9 vector<int> v; 10 for( ...
分类:
编程语言 时间:
2021-04-19 15:55:39
阅读次数:
0
题目链接 A. Average Height 奇数放一侧,偶数放一侧即可。 AC代码如下: #include<cstring> #include<algorithm> #include<cmath> #include<iostream> #include<queue> #include<cstdio ...
分类:
其他好文 时间:
2021-04-19 15:52:38
阅读次数:
0
##思路 最长上升子序列的变形+记录路径 ##AC代码 #include<iostream> #include<cmath> #include<string.h> #include<algorithm> #include<stdio.h> #include<iomanip> #define inf ...
分类:
其他好文 时间:
2021-04-19 14:43:51
阅读次数:
0
BFS可以延伸的应用变化繁多,这道题配合状态压缩共同解决,不过时空复杂度还可以进一步优化。 #include <iostream> #include <algorithm> #include <queue> #include <string> #include <vector> #include < ...
分类:
其他好文 时间:
2021-04-19 14:36:16
阅读次数:
0
VS2010 NX8.5 #include<algorithm>#include <sstream>#include <iomanip> //定义涵数 NXString doubleToNXString(double value);//double转换NXString NXString intToN ...
分类:
其他好文 时间:
2021-04-16 12:13:21
阅读次数:
0
<button id="delAll">批量删除</button>//给按钮一个id属性 <input type="checkbox" name="check" checkid="{{$v->id}}">//给input设置一个自定义的id <script src="https://apps.bdi ...
分类:
其他好文 时间:
2021-04-15 12:05:39
阅读次数:
0