摘要: 题目链接:https://www.luogu.com.cn/problem/P3369 参考:https://www.cnblogs.com/trsins/p/17970745 (思路是自己想的) 特别需要注意的点 因为区间内存在负数,所以 mid 的取法应该写成: mid = (l + r) >> 阅读全文
posted @ 2025-03-07 21:36 quanjun 阅读(6) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://codeforces.com/contest/69/problem/E 解题思路来自:https://www.cnblogs.com/trsins/p/17970745 示例程序: #include <bits/stdc++.h> using namespace std; 阅读全文
posted @ 2025-03-03 13:08 quanjun 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://www.luogu.com.cn/problem/P1908 解题思路完全参考自:https://www.cnblogs.com/trsins/p/17970745 示例程序: #include <bits/stdc++.h> using namespace std; co 阅读全文
posted @ 2025-03-03 12:42 quanjun 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 目录题目描述输入格式输出格式样例样例输入1样例输出1样例输入2样例输出2说明/提示数据规模与约定题解 题目描述 给你一个长度为 n 的数列 a1,a2,,an。 接下来有 q 次操作,操作分为如下两种类型: \(\mathtt{1\ l\ r\ x}\ 阅读全文
posted @ 2025-02-10 00:31 quanjun 阅读(44) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://www.luogu.com.cn/problem/P5318 题目大意:求图的dfs序及bfs序。 视频讲解地址:https://www.bilibili.com/video/BV1nuFve9Ecu/ 示例程序: #include <bits/stdc++.h> usin 阅读全文
posted @ 2025-02-01 19:56 quanjun 阅读(10) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://codeforces.com/contest/2055/problem/B 解题思路: 首先,如果存在至少两个 ai<bi,就面临一个局面,就是: 我不够问你要,然后你也不够问我要。 此时,如果我借给你那么更不够了,你借给我你就不够了。 所以如果至少存在 阅读全文
posted @ 2025-01-13 03:47 quanjun 阅读(74) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://oj.haizeix.com/problem/251 解题思路: 最短总距离是所有点到中位数的距离之和。 对 y:排序求中位数。 对 x:对 x 排序,然后对排序后的 xii 排序,然后求最短距离。 对 xii 进行处 阅读全文
posted @ 2025-01-07 16:50 quanjun 阅读(11) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://atcoder.jp/contests/abc380/tasks/abc380_d 题目大意: 给定一个字符串 S,该字符串由大写和小写英文字母组成。 我们对 S 执行 10100 次以下操作: 首先,通过将 S 中的大写字母转换为小写 阅读全文
posted @ 2024-12-31 12:20 quanjun 阅读(4) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://www.luogu.com.cn/problem/P3605 解题思路: 首先需要离散化一下。 然后就是套 树上启发式合并模板了,期间用树状数组维护一下区间和。 时间复杂度:O(nlog2n)。 示例程序: #include <bits/stdc++.h> 阅读全文
posted @ 2024-12-19 15:33 quanjun 阅读(28) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://acm.hdu.edu.cn/showproblem.php?pid=5755 题目大意:略 解题思路:略(因为是模板题) 示例程序: #include <bits/stdc++.h> using namespace std; const int maxn = 33 * 3 阅读全文
posted @ 2024-12-16 18:42 quanjun 阅读(14) 评论(0) 推荐(0) 编辑
点击右上角即可分享
微信分享提示