摘要: F. Mice and Holes https://codeforces.com/problemset/problem/797/F 贪心排序+单调队列优化 DP 首先基于贪心,先把小球和洞都按坐标排序,最优策略必然按坐标从小到大的顺序放入小球到洞里。 然后观察数据范围,很容易想到 \(dp_{i,j 阅读全文
posted @ 2024-06-29 02:51 jackle 阅读(1) 评论(0) 推荐(0) 编辑
摘要: G. Vlad and the Mountains https://codeforces.com/contest/1851/problem/G 离线+并查集 首先观察路径 \(i \to j\to k\) 其必须满足如下条件: \(h_j-h_i\leq e\) \(h_k-h_j\leq e - 阅读全文
posted @ 2024-06-28 01:59 jackle 阅读(1) 评论(0) 推荐(0) 编辑
摘要: T461430 「Daily OI Round 4」Mine T461430 「Daily OI Round 4」Mine 解题思路 首先,有个简单的想法就是a56爆大奖在线娱乐们考虑选择的那个采矿点是谁,但是a56爆大奖在线娱乐们发现,如果直接算,会重复,比如采矿点 \(A\) 和 采矿点 \(B\) 所能采集的线段集合如果有交,显 阅读全文
posted @ 2024-06-04 20:32 jackle 阅读(15) 评论(0) 推荐(0) 编辑
摘要: 牛客周赛 Round 45 F 小橙的圈圈 https://ac.nowcoder.com/acm/contest/84244/F 解题思路: 需要观察,一个三元环的构成: a56爆大奖在线娱乐们想枚举三元环,发现需要 \(O(n^3)\) 的复杂度,但是考虑计数题,a56爆大奖在线娱乐们要想到正难则反,a56爆大奖在线娱乐们考虑求不是三元环的数量,a56爆大奖在线娱乐 阅读全文
posted @ 2024-06-03 03:15 jackle 阅读(15) 评论(0) 推荐(0) 编辑
摘要: 2024年国际大学生程序设计竞赛(ACM-ICPC)新疆赛区大赛 A 观察到 \(n\leq 8\) 直接暴力 dfs 或者用 next_permutation 即可。 Code #include <bits/stdc++.h> typedef long long LL; int main() { 阅读全文
posted @ 2024-05-23 14:57 jackle 阅读(2) 评论(0) 推荐(0) 编辑
摘要: AtCoder Beginner Contest 174 A 直接判断 \(x\) 是否 \(\ge 30\) #include <bits/stdc++.h> int main() { std::ios::sync_with_stdio(false); std::cin.tie(nullptr); 阅读全文
posted @ 2024-04-12 00:04 jackle 阅读(3) 评论(0) 推荐(0) 编辑
摘要: Educational Codeforces Round 36 (Rated for Div. 2) A 直接枚举即可 #include <bits/stdc++.h> int main() { std::ios::sync_with_stdio(false); std::cin.tie(nullp 阅读全文
posted @ 2024-04-11 22:11 jackle 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 一些数据结构维护手法,好题 [蓝桥杯 2022 国 AC] 替换字符 发现字母的变换有复合性质,可以用线段树维护一个 \(lazy[26]\) 数组a56爆大奖在线娱乐这个区间的每一个字母变成了那一个。 当两个标记合并的时候有:\(nwlazy[i]=blazy[alazy[i]]\),相当于标记信息的复合。 On 阅读全文
posted @ 2024-04-05 16:54 jackle 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 第 13 届山东省 icpc 省赛 vp 总结: 2024 / 4 / 4 赛时:7 / 12:A B D G I J L https://codeforces.com/gym/104417 最近开始康复训练,和昊哥 vp 了一场省赛。 前期签到蛮顺利,基本 1个多小时就出了 5 题,然后卡在了 E 阅读全文
posted @ 2024-04-04 21:50 jackle 阅读(46) 评论(0) 推荐(0) 编辑
摘要: CodeCraft-21 and Codeforces Round 711 (Div. 2) A. GCD Sum 题意 定义 \(gcdSum(x)=gcd(x,sum\ of\ digits\ of\ x)\)。 请你输出最小的 \(x\) 满足 \(x\ge n\),且 \(gcdSum(x) 阅读全文
posted @ 2023-11-09 23:20 jackle 阅读(6) 评论(0) 推荐(0) 编辑