2026牛客寒假集训营3题解(部分)

2026牛客寒假集训营3题解(部分)

A-宙天 考虑到 x 非常小,暴力枚举前10个 k 即可。 AC代码: #include<bits/stdc++.h> using namespace std; #define int long long const int N=2e5+5,mod=998244353; int x; signed

2026牛客寒假算法基础集训营2-D 数字积木题解

【题解】数字积木:树上 MEX 求和与动态骨架维护 (DFS版) 1. 题目背景与大意 题目名称: Bingbong的积木树 (Tree MEX Sum) 给定一棵包含

题解 
2026牛客寒假算法基础集训营2-D	数字积木题解
第二周题解

第二周题解

第A题 思路:先找R1的最大值,再去遍历找R2. #include<bits/stdc++.h> using i64 = long long; int n; std::vector<int> d , c; void update(int x) { int tim = 1; while(x <=

寒假第一周题解

A题 题目要求为给出一串数,要求查询这一串数中的每个数,但需要"字典",字典根据已查询的数来制定,即正在查询的数未在字典中就添加,但字典有最大容量,在字典中未找到查询数就计数,问计数量.

寒假第一周题解
2026寒假第一周作业题解

2026寒假第一周作业题解

第一周寒假作业,供交流想法。 A题: 简单题目,按描述用双端队列存储内存内容。在到达m前只存,到达m后边存边删。 代码如下: #include <bits/stdc++.h> int main() { std::ios::sync_with_stdio(false); std::c

题解 

我的算法竞赛模板

__builtin __builtin_clz(a) std::hypotl 计算 (x, y) 平方和开平方根 std::hypotl(x, y) list std::list<int> list; list.push_front(0); std::vector<std::list<int>:

我的算法竞赛模板
小狗加训日记 - 数据结构

小狗加训日记 - 数据结构

abc423 E - Sum of Subarrays 题意:求 \sum_{L \le l \le r \le R} a_i。 通过贡献法,转化为 \sum_{L \le l \le i \le r \le R} {a_i} = \sum_{i \in[L, R]}{a_i} \times \su