本题的关键是从可选择方法中选择哪一类最优化 答案是结束时间最早的一类 源代码 #include<iostream>#include<algorithm>#include<cstdio>#define maxn 100100using namespace std;struct w{ int endd, ...
分类:
其他好文 时间:
2020-05-29 13:27:58
阅读次数:
55
1、while 循环:当条件成立执行循环体,否则跳出循环 语法结构 while 条件 loop 循环体 end loop; eg:1加到3的循环体 declare ls_number number:=0;--结果值i number:=1;--计数器begin while i<=3 loop ls_n ...
分类:
数据库 时间:
2020-05-28 16:32:29
阅读次数:
76
原题:hdu1312 B: 不要停下来啊 题目描述 丁丁妹因为上山挖大头菜而误打误撞进入了一处古代遗迹,古代遗迹是一个n×m n × m 的迷宫,丁丁妹所处的位置用'@'标出,'.'表示道路,'#'表示墙壁。为了逃出迷宫,丁丁妹想知道她最长能在迷宫中走多少格。我们的目的地根本不重要,只要继续前行就好 ...
分类:
其他好文 时间:
2020-05-27 22:05:46
阅读次数:
101
UVA-1103(Ancient Messages,World Finals) http://uva.onlinejudge.org/external/11/p5130a.png 输入H行W列的字符矩阵(H<=200, W<=50) 每个字符都是16进制数字,将他们转化为二进制后产生的图形中有'1' ...
分类:
其他好文 时间:
2020-05-27 15:54:42
阅读次数:
76
std::erase: (1)string& erase ( size_t pos = 0, size_t n = npos ); std::string test = "Hello erase!"; test.erase(2, 6); //test.erase(2); //删除指定字符串 //te ...
分类:
其他好文 时间:
2020-05-27 12:27:35
阅读次数:
65
传送门 神仙题,看题解看了一个多小时才看懂 首先我们设$Pre_i$和$suf_i$分别表示$1$到$i$需要的额外油量和$i$到$1$需要的额外油量,那么有 \[ \begin{aligned} Pre_i=Pre_{i-1}-a_{i-1}+w_{i-1}\\ suf_i=suf_{i-1}-a ...
分类:
其他好文 时间:
2020-05-27 12:17:56
阅读次数:
64
min_25筛是min_25发明的能在$O(\frac{n^{\frac 3 4}}{log_2n})$复杂度内解决一类积性函数前缀和的算法,这类函数在自变量为质数的取值必须为多个完全积性函数的线性组合。 ...
分类:
其他好文 时间:
2020-05-25 00:19:55
阅读次数:
55
1. set set 是关联容器,含有键值类型对象的已排序集,搜索、移除和插入拥有对数复杂度。 set 内部通常采用红黑树实现。和数学中的集合相似, set 中不会出现值相同的元素。 插入与删除操作: insert(x) : 当容器中没有等价元素的时候,将元素 x 插入到 set 中 erase(x ...
分类:
其他好文 时间:
2020-05-24 20:54:37
阅读次数:
63
先排序,然后固定一个值,使用双指针计算结果。 时间复杂度O(n^2),空间复杂度O(1) class Solution { public: vector<vector<int>> threeSum(vector<int>& nums) { vector<vector<int> > res; int ...
分类:
其他好文 时间:
2020-05-24 20:45:40
阅读次数:
48
一、wm_concat 多行字符串拼接有如下员工部门表emp_dept,数据如下:;需要实现如下结果 就需要用到wm_concat 函数:sql如下: select dept_name 部门, wm_concat(t.emp_name) 员工 from emp_dept t group by dep ...
分类:
其他好文 时间:
2020-05-24 19:30:39
阅读次数:
78