BaiJay
BaiJay
全部文章
分类
题解(10)
归档
标签
去牛客网
登录
/
注册
BaiJay的博客
全部文章
(共55篇)
题解 | 验证栈序列
#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
72
题解 | 自动管理停车场桩位系统
#include <climits> class Solution { public: stack<int>q ; stack<int>minn ; void push(int value) { q.push...
2026-01-15
1
67
题解 | 栈和排序
#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
79
题解 | 小A取石子
很明显这是Nim游戏的博弈规则,加上了一点小技巧 。 回忆博弈论,当所有数异或不为0的时候,先手必胜 。 而如果异或为0,如果k不为0,即我们可以进行操作,那么我们只要有一个数能让我们拿走k个,就能使得异或不为0。 #include <bits/stdc++.h&g...
2026-01-15
1
59
题解 | 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
78
题解 | 旺仔哥哥转圈圈
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * 计算出旺仔哥哥最后会站在哪位小朋友旁边 * @param a int整型vector 第 i 个小朋友的数字...
2026-01-12
1
84
题解 | 逗号整合器
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * 整理出一个将序列中的数字以逗号隔开从而得到的字符串 * @param a int整型vector 需要整理的...
2026-01-12
2
63
题解 | 旺仔哥哥挤地铁
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * 计算旺仔哥哥在地铁上的最长停留时间 * @param t int整型vector 序列 t,表示地铁在相邻...
2026-01-12
1
70
题解 | 向量叉乘
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * 计算出这两个向量叉乘的结果 * @param vector1 int整型vector * @pa...
2026-01-12
3
71
题解 | 两直线交点
#include <bits/stdc++.h> using namespace std; struct point { double x, y; point(double A, double B) { x = A, y = B; } p...
2026-01-12
1
69
首页
上一页
1
2
3
4
5
6
下一页
末页