上一页 1 2 3 4 5 6 7 8 ··· 19 下一页
摘要: 这道题虽然难度很低,但是细节不少 1.要先处理减,再处理加。因为是先经历了空档期的优先级衰减,然后才有订单带来的优先级提升;先减后加的时候有0这个下限兜底,如果先加后减可能会导致答案偏小。 2.减之后和加之后都要check一下,如果in_cache为true,减完之后小于等于三,但是加了以后又上升到 阅读全文
posted @ 2024-03-19 15:18 Gold_stein 阅读(5) 评论(0) 推荐(0) 编辑
摘要: 你好!如果你在 Ubuntu 虚拟机中遇到域名解析失效的问题,我可以提供一些解决方法。请注意,以下方法适用于 VMware 虚拟机中的 Ubuntu。 修改 DNS 设置: 打开终端(命令行)。 输入以下命令以编辑 resolv.conf 文件: sudo vi /etc/resolv.conf 进 阅读全文
posted @ 2024-03-19 09:01 Gold_stein 阅读(512) 评论(0) 推荐(0) 编辑
摘要: 根号分治之类的思路分析这里就不讲了,主要关注代码细节: #include <iostream> #include <stdio.h> #include <algorithm> #include <vector> #include <string> #include <cmath> #define F 阅读全文
posted @ 2024-03-18 23:01 Gold_stein 阅读(3) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <stdio.h> #include <algorithm> #include <string> #include <vector> #include <cstring> #include <queue> #include <cmath> # 阅读全文
posted @ 2024-03-15 14:57 Gold_stein 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 可持久化权值线段树 #include <iostream> #include <stdio.h> #include <algorithm> #include <string> #include <cmath> #include <cstring> #include <vector> #define 阅读全文
posted @ 2024-03-13 16:37 Gold_stein 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 可持久化字典树 #include <iostream> #include <stdio.h> #include <algorithm> #include <string> #include <cmath> #define For(i, j, n) for(int i = j ; i <= n ; + 阅读全文
posted @ 2024-03-11 21:25 Gold_stein 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 这道题出得很妙。 首先,对原数组求前缀和,然后我们能够发现,对ai进行操作就相当于交换(s[i],s[i-1]),然后就把原问题转化成维护一个先下凸,后上凸的双峰函数。 #include <iostream> #include <stdio.h> #include <algorithm> #incl 阅读全文
posted @ 2024-03-11 10:46 Gold_stein 阅读(9) 评论(0) 推荐(0) 编辑
摘要: 这题没想到怎么贪心,看题解恍然大明白 #include <iostream> #include <stdio.h> #include <algorithm> #include <string> #define For(i, j, n) for(int i = j ; i <= n ; ++i) us 阅读全文
posted @ 2024-03-09 20:58 Gold_stein 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 实际上这道题不需要先排序再求gcd,因为无论是哪两项之前作差,都不会影响最后的gcd的结果。 因为公差是从a2-a1开始算的,因此i=1时要特殊处理,不能把a1-0计入贡献,否则会算出错误的gcd。 即作差时不要加上a1-0,统计最值时不要漏掉a1 #include <iostream> #incl 阅读全文
posted @ 2024-03-09 20:43 Gold_stein 阅读(14) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <stdio.h> #include <algorithm> #include <string> #define For(i, j, n) for(int i = j ; i <= n ; ++i) using namespace std; 阅读全文
posted @ 2024-03-07 08:52 Gold_stein 阅读(1) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 19 下一页