摘要: 题目传送门 点击查看代码 #include<bits/stdc++.h> using namespace std; constexpr int N = 2e5 + 10; using LL = long long; LL a[N], t[2][N]; // a存储原始数据,t是二维树状数组,t[0] 阅读全文
posted @ 2025-11-28 15:41 mark2025 阅读(0) 评论(0) 推荐(0)
摘要: 传送门 代码1 点击查看代码 #include<bits/stdc++.h> using namespace std; struct game{//结构体用来存放每个游戏的时间和利益 int t; int r; }a[505]; bool cmp(game a,game b){//cmp函数(结构体 阅读全文
posted @ 2025-11-06 15:26 mark2025 阅读(8) 评论(0) 推荐(0)
摘要: 传送门 map+BFS 点击查看代码 #include<bits/stdc++.h> using namespace std; using LL=long long; // 使用long long类型存储状态 LL n; // 存储初始状态 // 方向数组:下、右、左、上(对应空格移动的四个方向) 阅读全文
posted @ 2025-11-05 10:42 mark2025 阅读(8) 评论(0) 推荐(0)
摘要: 传送门 记忆化搜索 点击查看代码 #include<bits/stdc++.h> using namespace std; using LL=long long; // 定义长整型别名 constexpr int N=110; // 定义最大行数 LL a[N][N]; // 存储数字金字塔 LL 阅读全文
posted @ 2025-11-04 09:46 mark2025 阅读(6) 评论(0) 推荐(0)
摘要: 题目传送门 阅读全文
posted @ 2025-10-31 14:44 mark2025 阅读(3) 评论(0) 推荐(0)
摘要: 题目传送门 `` 点击查看代码 #include<bits/stdc++.h> using namespace std; int q,b=0,mib=0;//平衡度 过程中的最小平衡度 //满足最终平衡度为0 //过程中的最小平衡度为0 //() 遇见(b+1 遇见)b-1 //最终只要是好的括号就 阅读全文
posted @ 2025-10-24 11:12 mark2025 阅读(6) 评论(0) 推荐(0)
摘要: 题目传送门 代码 点击查看代码 #include<bits/stdc++.h> using namespace std; const int N=2e4+10; int n; int l[N],r[N],len[N]; int dp[N][2]; //dp[i][0]表示停留在本行左端点 //那么就 阅读全文
posted @ 2025-09-18 14:32 mark2025 阅读(5) 评论(0) 推荐(0)