上一页 1 2 3 4 5 6 7 ··· 28 下一页
摘要: G. China Convex Polygon Contest 反悔贪心。 首先可以考虑对 \(b\) 排序,显然思考越快的题可以使手里攒着的题更多更有选择的空间。 如果正着贪心的话就是,当前能做就立马提交,如果当前的时间更优但选不了就从之前丢一个小的然后选择当前;但是会存在这样一个情况,刚开始把 阅读全文
posted @ 2025-10-11 12:31 Ke_scholar 阅读(37) 评论(0) 推荐(0)
摘要: A - El fucho 模拟。 胜者组共有 \(n-1\) 队进入败者组,进入败者组的会淘汰 \(n-2\) 队,最后剩两组再进行一场,总场数 \(2n-2\)。 不会算也可以直接模拟。 点击查看代码 #include <bits/stdc++.h> using i64 = long long; 阅读全文
posted @ 2025-10-10 15:20 Ke_scholar 阅读(160) 评论(0) 推荐(0)
摘要: A - Candies for Nephews 模拟。 看 \(3\) 的余数。 点击查看代码 #include <bits/stdc++.h> using namespace std; using i64 = long long; void solve() { int n; std::cin >> 阅读全文
posted @ 2025-10-07 14:20 Ke_scholar 阅读(44) 评论(1) 推荐(0)
摘要: A - Increase or Smash 模拟。 对于每个不是最大值的来说,都会经历一次先置为零然后再加的操作,重复项只计算一次;而最大值不用置为零,所以最开始会有一次。 点击查看代码 #include <bits/stdc++.h> using namespace std; using i64 阅读全文
posted @ 2025-10-05 22:16 Ke_scholar 阅读(61) 评论(0) 推荐(0)
摘要: 洛谷模板测试七倍经验: https://www.luogu.com.cn/record/238785118 https://www.luogu.com.cn/record/238783283 https://www.luogu.com.cn/record/238788990 https://www. 阅读全文
posted @ 2025-10-05 17:42 Ke_scholar 阅读(20) 评论(0) 推荐(0)
摘要: A. Best Player 模拟。 题意是分别站在 \(X,Y,Z\) 轴上看另外两维构成的点,谁看到的更多。 分别对三维维护一个 \(\text{pair}\) 去重比较即可。 点击查看代码 #include<bits/stdc++.h> using namespace std; #define 阅读全文
posted @ 2025-10-02 15:50 Ke_scholar 阅读(32) 评论(0) 推荐(0)
摘要: B - Bitwise Exclusive-OR Sequence 种类并查集。 根据每一对的异或关系,可以得到二进制中每一位是否互斥关系,涉及到两种关系的处理用种类并查集更好维护;另外再维护两个点之间是否有关系,之后可能形成多个关系的集合,每个集合又分成了互斥的两个部分,对少的那一堆赋值为 \(1 阅读全文
posted @ 2025-10-01 22:25 Ke_scholar 阅读(28) 评论(0) 推荐(0)
摘要: template<class Info, class Tag> struct LazySegmentTree { int n; std::vector<Info> info; std::vector<Tag> tag; LazySegmentTree() : n(0) {} LazySegmentT 阅读全文
posted @ 2025-10-01 20:52 Ke_scholar 阅读(20) 评论(1) 推荐(0)
摘要: mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count()); 阅读全文
posted @ 2025-09-28 22:22 Ke_scholar 阅读(23) 评论(0) 推荐(0)
摘要: A. Be Positive 模拟。 只需要把负数和零变为正即可。 点击查看代码 #include <bits/stdc++.h> using namespace std; using i64 = long long; void solve() { int n; cin >> n; int cnt[ 阅读全文
posted @ 2025-09-27 19:55 Ke_scholar 阅读(73) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 ··· 28 下一页