chenlan114
chenlan114
全部文章
分类
归档
标签
去牛客网
登录
/
注册
chenlan114的博客
全部文章
(共22篇)
题解 | 华华给月月准备礼物
#include <bits/stdc++.h> using namespace std; using ll=long long; const ll M=2e5+5; ll a[M]; // 存储原始数据(例如:各段绳子的长度) ll N,K; // N:原始数据的个数,K:需要满...
2026-01-02
0
20
题解 | 【模板】01背包(计数)
#include <bits/stdc++.h> using namespace std; struct it { int v = 0; int w = 0; }; const int N = 1e4 + 5; const int M = 1e9 + 7; it a[N...
2026-01-01
0
20
题解 | 先序遍历、中序遍历和后序遍历
#include <bits/stdc++.h> using namespace std; // 定义二叉树节点结构,存储每个节点的左孩子和右孩子(0表示无对应孩子节点) struct k{ int left=0; int right=0; }; // 邻接表存储整棵...
2026-01-01
0
27
题解 | 小红的01串
#include <iostream> using namespace std; using ll = long long; int main() { ll q; cin >> q; // 步骤1:处理多组测试用例(q组查询) while (...
2025-12-31
0
24
题解 | 人人都是好朋友
#include<iostream> #include<map> #include <unordered_map> using namespace std; using ll = long long; /* 大数据量场景(如 n=1e5、1e6,节点数极多):...
2025-12-30
0
20
题解 | 变幻莫测
#include <bits/stdc++.h> using namespace std; using ll=long long; using PII=pair<ll,ll>; queue<PII> q; // 算法思想:使用map做状态去重,避免重复探索同一(X...
2025-12-28
0
17
题解 | 【模板】01背包
#include <iostream> using namespace std; // 新增:定义负无穷(表示「无法装满」的非法状态) const int INF = 0x3f3f3f3f; struct it { int v = 0; int w = 0; }; c...
2025-12-26
0
28
题解 | 小红的圆移动
#include <bits/stdc++.h> using namespace std; using ll = long long; // 结构体存储每个圆的核心信息 struct C { long double x; // 圆心x坐标 long doubl...
2025-12-26
0
19
题解 | 收集金币
#include <bits/stdc++.h> using namespace std; using ll = long long; // 结构体:存储每个方格的信息 struct g { ll w; // 当前方格的金币数量 ll v = 0; // 当前方格变成...
2025-12-22
0
18
题解 | 排座椅
#include <bits/stdc++.h> using namespace std; using ll=long long; // 定义结构体pa,用于存储每一组交头接耳的两个相邻位置坐标 struct pa{ ll x; // 第一个位置的行号 ll y; ...
2025-12-21
0
19
首页
上一页
1
2
3
下一页
末页