BaiJay
BaiJay
全部文章
分类
题解(9)
归档
标签
去牛客网
登录
/
注册
BaiJay的博客
全部文章
(共54篇)
题解 | 结构体优先队列
#include<bits/stdc++.h> using namespace std; struct node{ int chinese, math, english, sum; }; bool operator<(node a, node b){ if(a.s...
2026-01-16
1
88
题解 | 不重复数字
#include <bits/stdc++.h> using ll = long long ; using namespace std; #define endl '\n' #define pb push_back #define ull unsigned long long #def...
2026-01-16
1
86
题解 | 宝石计数
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param jewels string字符串 * @param stones strin...
2026-01-16
1
99
题解 | 快乐数
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param n int整型 * @return bool布尔型 */ ...
2026-01-16
2
88
题解 | 数对计数
#include <bits/stdc++.h> using ll = long long ; using namespace std; #define endl '\n' #define pb push_back #define ull unsigned long long #def...
2026-01-16
1
84
题解 | 动态整数集最近值提取
#include <bits/stdc++.h> using ll = long long ; using namespace std; #define endl '\n' #define pb push_back #define ull unsigned long long #def...
2026-01-16
1
80
题解 | #小红的矩阵修改#
算法思路详解 状态表示选择:三进制状态压缩 由于每个位置存在三种状态,因此采用三进制进行状态压缩,以此来高效表示每一列的整体状态。 优化状态规模:选择列方向压缩 比较 n 和 m 的大小后,考虑到 3^m 的数值规模过大,无法高效处理,因此最终选择对每一列进行状态压缩,避免状态空间爆炸。 ...
2026-01-15
1
79
题解 | 队列消数
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param tickets int整型vector * @param k int整型 ...
2026-01-15
1
89
题解 | 无法吃午餐的学生数量
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param students int整型vector * @param sandwich...
2026-01-15
3
84
题解 | 验证栈序列
#include <bits/stdc++.h> using ll = long long ; using namespace std; #define endl '\n' #define pb push_back #define ull unsigned long long #def...
2026-01-15
1
70
首页
上一页
1
2
3
4
5
6
下一页
末页