ddhw111
ddhw111
全部文章
分类
题解(16)
归档
标签
去牛客网
登录
/
注册
ddhw111的博客
sajin_fan
全部文章
(共25篇)
题解 | 相邻的糖果
#include<bits/stdc++.h> #define endl "\n" #define int long long using namespace std; void slove() { int n, m, x; std::cin >...
2026-02-07
0
16
题解 | 子数列求积
#include<bits/stdc++.h> #define endl "\n" #define int long long using namespace std; struct node { int l, r, sum; } tree[4 * 10001...
2026-01-13
0
21
题解 | 区间取反与区间数一
#include<bits/stdc++.h> #define endl "\n" #define int long long using namespace std; struct node { int l, r, cnt, laz; } tree[5000...
2026-01-08
0
21
题解 | 明日DISCO
#include<bits/stdc++.h> #define endl "\n" #define int long long using namespace std; int d[4][2] = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}};...
2026-01-07
0
35
题解 | 先序遍历、中序遍历和后序遍历
#include<bits/stdc++.h> #define endl "\n" #define int long long using namespace std; void slove() { int n; std::cin >> n...
2026-01-01
0
29
题解 | 小红的01串
#include<bits/stdc++.h> #define endl "\n" #define int long long using namespace std; void slove() { std::string s; std::cin &g...
2025-12-31
0
29
题解 | 人人都是好朋友
#include<bits/stdc++.h> #define endl "\n" #define int long long using namespace std; struct node { int u, v, w; bool operator ...
2025-12-30
0
37
题解 | 秘藏
#include<bits/stdc++.h> #define endl "\n" #define int long long using namespace std; int dp[200010][2][2];// 1 biao 1 li void slove() ...
2025-12-24
0
22
题解 | 降温(easy)
贪心。要凑到最大的数量,让可以更改的位置的数值更改成为上一个离自己最近位置并且有数值的数-x。注意如果减到小于值域下限,我们可以直接更改为值域上限。这样做的目的是方便让后面的可更改位置产生贡献。凑最小的答案,就一直让可更改位置的数值更改为上一个值-x+1即可。 #include<bits/st...
2025-12-07
0
28
题解 | #分层图最短路#
分层图最短路 链接:https://ac.nowcoder.com/acm/problem/236176 来源:牛客网 做法:直接去连边的话因为数据范围过大,所以会出现tle的现象,也有段错误的现象不知道是为什么,所以对于层与层之间的边,我们建立一个平台,同层的点到这个平台的距离为0,层与层之间的距...
C++
2024-08-23
1
209
首页
上一页
1
2
3
下一页
末页