上一页 1 2 3 4 5 6 ··· 27 下一页
摘要: 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 阅读(22) 评论(1) 推荐(0)
摘要: A - Increase or Smash 模拟。 对于每个不是最大值的来说,都会经历一次先置为零然后再加的操作,重复项只计算一次;而最大值不用置为零,所以最开始会有一次。 点击查看代码 #include <bits/stdc++.h> using namespace std; using i64 阅读全文
posted @ 2025-10-05 22:16 Ke_scholar 阅读(44) 评论(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 阅读(7) 评论(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 阅读(10) 评论(0) 推荐(0)
摘要: B - Bitwise Exclusive-OR Sequence 种类并查集。 根据每一对的异或关系,可以得到二进制中每一位是否互斥关系,涉及到两种关系的处理用种类并查集更好维护;另外再维护两个点之间是否有关系,之后可能形成多个关系的集合,每个集合又分成了互斥的两个部分,对少的那一堆赋值为 \(1 阅读全文
posted @ 2025-10-01 22:25 Ke_scholar 阅读(9) 评论(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 阅读(7) 评论(1) 推荐(0)
摘要: mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count()); 阅读全文
posted @ 2025-09-28 22:22 Ke_scholar 阅读(8) 评论(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 阅读(46) 评论(0) 推荐(0)
摘要: A - Shortest Increasing Path 思维。 当 \(y>x\) 时,可以走 \(x\rightarrow y\) 两步即可;\(x \ge y + 2\) 时,可以走 \(1 \rightarrow y \rightarrow x - 1\) 三步即可,其余无解。 点击查看代码 阅读全文
posted @ 2025-09-25 20:53 Ke_scholar 阅读(119) 评论(0) 推荐(0)
摘要: A. Incremental Subarray 思维,观察。 把它那个数字表打出来观察,会发现如果给的 \(a\) 不是一段连续的区间,只会出现一次;否则看 \(a_m\),那么答案就是 \(\sum_{i=1}^n[i\ge a_m]=n-a_m+1\)。 点击查看代码 #include <bit 阅读全文
posted @ 2025-09-25 15:13 Ke_scholar 阅读(372) 评论(0) 推荐(2)
上一页 1 2 3 4 5 6 ··· 27 下一页