费姣人
费姣人
全部文章
分类
归档
标签
去牛客网
登录
/
注册
费姣人的博客
全部文章
(共25篇)
题解 | 链表相交
#include <bits/stdc++.h> using namespace std; struct ListNode { int val; ListNode *next; ListNode(int x) : val(x), next(NULL) {} };...
2026-02-03
1
76
题解 | 链表序列化
/** * struct ListNode { * int val; * struct ListNode *next; * ListNode(int x) : val(x), next(nullptr) {} * }; */ class Solution { public: /*...
2026-02-02
1
76
题解 | 移除链表元素
/** * struct ListNode { * int val; * struct ListNode *next; * ListNode(int x) : val(x), next(nullptr) {} * }; */ class Solution { public: /*...
2026-02-02
1
68
题解 | 宝石计数
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param jewels string字符串 * @param stones strin...
2026-01-31
1
57
题解 | 【模板】集合操作
#include<bits/stdc++.h> using namespace std; set <int> s;//元素唯一,且从小到大排列,multiset则可重复,基于红黑树 void insertValue(int x){ //TODO 实现插入逻辑 ...
2026-01-30
1
62
题解 | 机器翻译
#include <iostream> #include <queue> using namespace std; // 机器翻译,根据单词查找释义,缓存无,找外存,然后插入缓存中,如果缓存未满,则直接插入,满了,则删掉最早进入,然后插入最新,求在外存查字典的次数 const...
2026-01-30
1
67
题解 | 用两个栈实现队列
class Solution //用两个栈来实现队列,进行插入和删除操作, //插入:先将元素push进第一个栈 //删除操作:如果第二个栈有元素,就弹出第二个栈的元素(符合队列的先进先出), ///如果空,则将第一个栈中元素全部弹出,push进第二个栈中, //然后执行pop操作,...
2026-01-30
1
82
题解 | 队列消数
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param tickets int整型vector * @param k int整型 ...
2026-01-29
1
65
题解 | 验证栈序列
#include <iostream> #include <stack> using namespace std; // 入栈序列能等于出栈序列,输出是否;入栈序列一个个入栈,并于出栈序列比较,如果于出栈序列相等则出栈,循环语句,入栈前一个元素与下一个 出栈元素相等,则出栈...
2026-01-29
1
83
题解 | 直线与圆交点间距
#include <bits/stdc++.h> using namespace std; struct point{ double x,y; point(double A,double B){ x=A,y=B; } point() = ...
2026-01-24
1
46
首页
上一页
1
2
3
下一页
末页