上一页 1 ··· 26 27 28 29 30 31 32 33 34 ··· 45 下一页
摘要: 根号分治之类的思路分析这里就不讲了,主要关注代码细节: #include <iostream> #include <stdio.h> #include <algorithm> #include <vector> #include <string> #include <cmath> #define F 阅读全文
posted @ 2024-03-18 23:01 Gold_stein 阅读(29) 评论(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 阅读(5) 评论(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 阅读(12) 评论(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 阅读(11) 评论(0) 推荐(0)
摘要: 这道题出得很妙。 首先,对原数组求前缀和,然后我们能够发现,对ai进行操作就相当于交换(s[i],s[i-1]),然后就把原问题转化成维护一个先下凸,后上凸的双峰函数。 #include <iostream> #include <stdio.h> #include <algorithm> #incl 阅读全文
posted @ 2024-03-11 10:46 Gold_stein 阅读(23) 评论(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 阅读(18) 评论(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 阅读(50) 评论(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 阅读(12) 评论(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-05 15:33 Gold_stein 阅读(9) 评论(0) 推荐(0)
摘要: 做这道题的时候混淆了满二叉树和完全二叉树的概念: 满二叉树:顾名思义,就是塞满了 完全二叉树:除了最后一层之外,每一层都必须是满的,且最后一层如果不满,则所有节点都尽可能靠左。 #include <iostream> #include <stdio.h> #include <algorithm> # 阅读全文
posted @ 2024-03-04 12:17 Gold_stein 阅读(61) 评论(0) 推荐(0)
上一页 1 ··· 26 27 28 29 30 31 32 33 34 ··· 45 下一页