上一页 1 2 3 4 5 6 7 8 9 ··· 22 下一页

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 阅读(180) 评论(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 阅读(40) 评论(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 阅读(142) 评论(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 阅读(27) 评论(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 阅读(23) 评论(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 阅读(100) 评论(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 阅读(59) 评论(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 阅读(37) 评论(0) 推荐(0)

2025年7月5日

摘要: C. Large Queue 用队列维护二元组 (值,数量),本质上和ABC247D一样 代码实现 #include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using 阅读全文
posted @ 2025-07-05 23:32 V_Melville 阅读(76) 评论(0) 推荐(0)

2025年6月15日

摘要: C. Rotatable Array 首先 \(k\) 中只有 \(k\%N\) 次操作有用 执行 \(i\) 次操作后,点 \(p\) 位置上的数就会变成 \((p+i)\%N\) 位置上的数 对于操作 \(3\),用一个变量 offset 记录 \(k\%N\) 的累加和即可 代码实现 #inc 阅读全文
posted @ 2025-06-15 01:23 V_Melville 阅读(62) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 9 ··· 22 下一页