上一页 1 2 3 4 5 6 7 ··· 21 下一页

2025年8月17日

摘要: C. King's Summit 设所有点中行坐标极差为 \(\Delta R\),列坐标极差为 \(\Delta C\),则最短相遇时间为 \(\max(\lceil \frac{\Delta R}{2} \rceil, \lceil \frac{\Delta C}{2} \rceil)\) 代码 阅读全文
posted @ 2025-08-17 12:22 V_Melville 阅读(40) 评论(0) 推荐(2)

2025年8月10日

摘要: C. Flush 本题的关键是代入庄家思维! 要让你输掉游戏,最优策略必然是每次选 \(b-1\) 个茶包,因此最终答案为 \(1 + \sum \min(A_i, b-1)\) 可以先将 \(A\) 做升序排序,找到 \(A\) 中第一个大于等于 \(b-1\) 的位置,从这个位置往后的贡献必然都 阅读全文
posted @ 2025-08-10 12:47 V_Melville 阅读(135) 评论(0) 推荐(0)

2025年8月3日

摘要: C. Distance Indicators \(j-A_j = A_i+i\) 代码实现 #include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = 阅读全文
posted @ 2025-08-03 02:20 V_Melville 阅读(177) 评论(2) 推荐(1)

2025年7月27日

摘要: C. Concat (X-th) 爆搜 代码实现 // n进制枚举 #include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; int main() { int n, k, 阅读全文
posted @ 2025-07-27 16:08 V_Melville 阅读(35) 评论(0) 推荐(0)

2025年7月20日

摘要: C. Mixture bfs 代码实现 #include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; void solve() { int n; string s; cin 阅读全文
posted @ 2025-07-20 02:45 V_Melville 阅读(136) 评论(0) 推荐(0)

2025年7月16日

摘要: T1. 阿斯 令 \(k = \lceil\log_2 n\rceil\),\(M = 2^{k+1}-1\)。 首先我们试图构造一个异或和为 \(M\) 的集合 \(S\): 如果 \(u \oplus v = M\),则 \(\{u, v\}\) 合法 否则令 \(w = u \oplus v 阅读全文
posted @ 2025-07-16 20:46 V_Melville 阅读(23) 评论(0) 推荐(0)

2025年7月14日

摘要: T1. 美克斯 排列的性质非常优秀,考虑利用排列的性质快速求解。 注意到 \(\operatorname{mex}(S)\) 是 \(S\) 内没有出现的最小的自然数,又因为这是一个 \(0 \sim n-1\) 的排列,那么 \(\{a_l, a_{l+1}, \cdots, a_r\}\) 中未 阅读全文
posted @ 2025-07-14 15:59 V_Melville 阅读(20) 评论(0) 推荐(0)

2025年7月13日

摘要: C. Palindromic in Both Bases 枚举前一半的数位 代码实现 #include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = lo 阅读全文
posted @ 2025-07-13 00:25 V_Melville 阅读(99) 评论(0) 推荐(0)

2025年7月9日

摘要: C. Black Intervals 考虑翻转前后对答案有什么影响 代码实现 #include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; int main() { int 阅读全文
posted @ 2025-07-09 17:32 V_Melville 阅读(57) 评论(0) 推荐(0)

2025年7月6日

摘要: C. Giant Domino 首先如果 \(S_N \leqslant 2S_1\),那么只需要取出首尾两张骨牌即可 下面考虑一般情况 考虑将序列 \(S\) 做升序排序,位于 \(1\) 号骨牌前和 \(N\) 号骨牌后的骨牌都不需要再考虑了 取出 \(1\) 号骨牌和 \(N\) 号骨牌之间的 阅读全文
posted @ 2025-07-06 21:13 V_Melville 阅读(26) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 ··· 21 下一页