大时代1105
大时代1105
全部文章
分类
题解(12)
归档
标签
去牛客网
登录
/
注册
大时代1105的博客
全部文章
(共28篇)
题解 | #春游#
思路 贪心 过程 代码 #include <iostream> #include <climits> using namespace std; typedef long long LL; LL t, n, a, b; int main() { cin &...
2025-03-23
0
17
题解 | #消减整数#
思路 贪心 过程 代码 #include <iostream> using namespace std; int t, h; int func() { h --; int ans = 1, a = 1; while(h) { i...
2025-03-18
0
18
题解 | #二叉树中的最大路径和#
思路 树形dp 过程 代码 class Solution { int ans = INT_MIN; public: int maxPathSum(TreeNode* root) { dfs(root); return ans; ...
2025-03-17
0
22
题解 | #体操队形#
思路 dfs 过程 代码 #include <iostream> #include <unordered_map> using namespace std; int a[20], n, ans; bool st[20]; void dfs(int pos) { ...
2025-03-17
0
23
题解 | #主持人调度(二)#
思路 贪心 + 优先级队列 过程 时间复杂度: 代码 class Solution { public: int minmumNumberOfHost(int n, vector<vector<int>>& startEnd) { ...
2025-03-16
0
31
题解 | #空调遥控#
思路 暴力枚举 排序 + 二分 排序 + 滑动窗口 过程 时间复杂度: 时间复杂度: 时间复杂度 代码 排序 + 二分 #include <iostream> #include <climits> #include <algorithm> using ...
2025-03-15
0
20
题解 | #[NOIP2001]装箱问题#
思路 01背包 过程 代码 #include <iostream> using namespace std; const int N = 40, M = 2e4 + 10; int a[N], f[M]; int V, n; int main() { cin >...
2025-03-13
0
19
题解 | #分组#
思路 暴力枚举 + 二分优化 过程 代码 #include <iostream> #include <unordered_map> using namespace std; const int N = 1e5 + 10; int a[N]; int n, m; un...
2025-03-04
0
22
题解 | #删除相邻数字的最大分数#
思路 线性dp 过程 代码 #include <iostream> #include <vector> using namespace std; const int N = 1e5 + 10; int a[N], n; int main() { cin ...
2025-03-03
0
29
题解 | #重排字符串#
思路 贪心 过程 代码 #include <iostream> #include <vector> #include <unordered_map> #include <string> #include <queue> using ...
2025-03-03
0
30
首页
上一页
1
2
3
下一页
末页