叫啥名
叫啥名
全部文章
分类
归档
标签
去牛客网
登录
/
注册
叫啥名的博客
全部文章
(共81篇)
题解 | 【模板】队列
#include <iostream> #include <array> using namespace std; array<int, 100001> a;//--------因为操作数为100000,tail和head最多只可能到100000,可以直接数组表示...
2025-03-22
0
30
题解 | 【模板】栈
#include <iostream>//---------用的vector加一个指针模拟,其实可以直接用《stack》这个库的就是他的pop不会输出 #include <vector> using namespace std; int main() { int n, ...
2025-03-21
0
25
题解 | 旋转数组
class Solution {//-------这道题看官方题解更好一点,我也是看了才过的,写题解就是领个牛币 public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * 旋转数组 * @param ...
2025-03-21
1
17
题解 | 从单向链表中删除指定值的节点
#include <cstddef> #include <iostream> #include <vector> using namespace std; int len;//-------指向最后一位的索引 struct node{ int n; nod...
2025-03-21
1
26
题解 | 主持人调度(二)
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * 计算成功举办活动需要多少名主持人 * @param n int整型 有n个活动 * @param ...
2025-03-20
0
24
题解 | 判断是否为回文字符串
#include <algorithm> class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param str string字符串 待判断...
2025-03-20
0
30
题解 | 判断两个IP是否属于同一子网
#include <iostream> #include <array> using namespace std; bool check(array<int, 4>&arr){ for (int i = 0; i < 4; i++) i...
2025-03-20
0
30
题解 | 字符串变形
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param s string字符串 * @param n int整型 * @...
2025-03-19
0
27
题解 | 蛇形矩阵
#include <cstdio> #include <iostream> using namespace std; int main() {//---------找规律 int n; cin >> n; int a = 1, pro = 1; ...
2025-03-19
0
27
题解 | 没有重复项数字的全排列
#include <algorithm> class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param num int整型vector ...
2025-03-18
0
36
首页
上一页
1
2
3
4
5
6
7
8
9
下一页
末页