BaiJay
BaiJay
全部文章
分类
题解(4)
归档
标签
去牛客网
登录
/
注册
BaiJay的博客
全部文章
(共46篇)
题解 | 无法吃午餐的学生数量
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param students int整型vector * @param sandwich...
2026-01-15
3
44
题解 | 验证栈序列
#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
36
题解 | 自动管理停车场桩位系统
#include <climits> class Solution { public: stack<int>q ; stack<int>minn ; void push(int value) { q.push...
2026-01-15
1
35
题解 | 栈和排序
#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
40
题解 | 小A取石子
很明显这是Nim游戏的博弈规则,加上了一点小技巧 。 回忆博弈论,当所有数异或不为0的时候,先手必胜 。 而如果异或为0,如果k不为0,即我们可以进行操作,那么我们只要有一个数能让我们拿走k个,就能使得异或不为0。 #include <bits/stdc++.h&g...
2026-01-15
1
35
题解 | many sum
当你发现要优化一下时间复杂度就可以暴力过be like #include <bits/stdc++.h> #define int long long using namespace std; #define endl '\n' #define pb push_back #define u...
2026-01-14
1
45
题解 | 旺仔哥哥转圈圈
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * 计算出旺仔哥哥最后会站在哪位小朋友旁边 * @param a int整型vector 第 i 个小朋友的数字...
2026-01-12
1
37
题解 | 逗号整合器
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * 整理出一个将序列中的数字以逗号隔开从而得到的字符串 * @param a int整型vector 需要整理的...
2026-01-12
2
30
题解 | 旺仔哥哥挤地铁
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * 计算旺仔哥哥在地铁上的最长停留时间 * @param t int整型vector 序列 t,表示地铁在相邻...
2026-01-12
1
37
题解 | 向量叉乘
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * 计算出这两个向量叉乘的结果 * @param vector1 int整型vector * @pa...
2026-01-12
3
40
首页
上一页
1
2
3
4
5
下一页
末页