算法小学生h航
算法小学生h航
全部文章
分类
题解(4)
归档
标签
去牛客网
登录
/
注册
算法小学生h航的博客
全部文章
(共4篇)
题解 | #贪心只能过样例#
#include<bits/stdc++.h> using namespace std; int main() { int t; cin>>...
C++
贪心
2026-04-27
0
21
题解 | #贪心算法(新生题)#
此题为贪心的区间覆盖,应尽可能选结束时间最早的科目。 以下是此题代码(c++格式) #include<bits/stdc++.h> using namespace std; //创建结构体,l代表左区间,r代表右区间 struct seg { &n...
C++
贪心
2026-04-25
0
19
题解 | #二分裸题#
此题应用贪心和二分算法 此题分几步做 1.因为贵的房子不一定舒适所以应先排序舒适度(从大到小) 2.拥有金币数量的人排序(从穷到富) 3.想让舒适度最大应该让 买的起最大舒适度房子的人(前提条件)中最少金币持有者(能买的起房子中...
C++
二分查找
贪心
2026-04-16
1
20
题解 | #智乃酱的前缀和与差分#
以下是此题代码 #include<bits/stdc++.h> using namespace std; const int MOD = 998244353; const int G = 3; int modpow(int a, int e) { int res = 1; while (...
C++
数学
组合数学
2026-04-13
0
32