怎么不AC啊
怎么不AC啊
全部文章
分类
题解(1)
归档
标签
去牛客网
登录
/
注册
怎么不AC啊的博客
全部文章
(共14篇)
题解 | #计数#
题目目标在于找到各个连续0序列,算出计数贡献后乘起来。 因此, 核心的任务在于,对于一个[l,0,0,...,0,r]的序列,如何求出其计数贡献。 我们将0的个数记为,形式化地,问题为: 个数的数列满足以下表达式,求符合的数量 这个事情的需求有两个: 单调不减 整个数列在内 如果我们要手动...
2026-01-29
1
10
题解 | #游游的二进制树#
暴力即可:枚举起点dfs。理论上时间复杂度为, 不过由于路径值增长很快(每加一位数,相当于乘以2,大于后即可剪枝),因此单次dfs深度不超过,因此实际时间复杂度为 #include <iostream> #include <string> #include <vect...
2026-01-27
0
13
题解 | #many sum#
计算即可,但需要注意,如果直接枚举计算,将会是的复杂度,我们需要跳过一些不必要的计算:如果对有贡献,那么对都有贡献,因此可以从枚举,计算对哪些项有贡献。 事实上,形如以下的(比如说大运算符换成求积),若需要求整个,都可以这么算,可以证明总时间复杂度为. 时间复杂度的证明并不困难,这里仅粗略解释一下...
2026-01-14
0
26
题解 | 人人都是好朋友
#include <cassert> #include <iostream> #include <unordered_map> #include <vector> #include <bits/stdc++.h> using namespa...
2025-12-30
0
33
题解 | 圣
#include <iostream> using namespace std; // n=2 // 0 0 -> 0 // 1 0 -> 1 // 0 1 -> 1 // 1 1 -> 0 // inner loop : a_i&a1 | a_i&...
2025-12-23
0
25
题解 | 小猫排队
#include <iostream> #include <queue> #include <vector> using namespace std; int main() { int n; cin >> n; vector&...
2025-12-22
0
21
题解 | 至
#include <any> #include <cstdlib> #include <iostream> #include <utility> using namespace std; // corner case : 一者已经在终点--> b...
2025-12-20
0
22
题解 | #剩下的数#
由于,存在s.t. ,因此数组 进而等价于,由于成环,进而等价于 考虑,若,那么全部一次即可删除,若非零,那么, ,由于成环,将之外的数全部删除即会留下一个无法删除的数。因此结果即为 #include <iostream> using namespace std; int main()...
2025-12-17
0
22
题解 | #小红炸砖块#
#include <bits/stdc++.h> using namespace std; int main(){ int n,m,k; cin >> n >> m >> k; vector<int> blankC...
C++
2025-12-12
0
20
题解 | 大撒币
#include <iostream> #include <string> using namespace std; static inline uint64_t splitmix64(uint64_t x) { x += 0x9e3779b97f4a7c15; ...
2025-12-10
0
30
首页
上一页
1
2
下一页
末页