金刚侠
金刚侠
全部文章
分类
归档
标签
去牛客网
登录
/
注册
金刚侠的博客
全部文章
(共81篇)
题解 | 判断一个链表是否为回文结构
/** * struct ListNode { * int val; * struct ListNode *next; * ListNode(int x) : val(x), next(nullptr) {} * }; */ #include <vector> class S...
2025-12-26
0
21
题解 | 向量点乘
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * 计算两个三维向量的点乘结果 * @param vector1 int整型vector 第一个向量 ...
2025-12-26
0
19
题解 | 求峰谷点数
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * 求序列a中的峰、谷点的个数 * @param a int整型vector 序列a * @retur...
2025-12-26
0
18
题解 | 序列链表化
/** * struct ListNode { * int val; * struct ListNode *next; * ListNode(int x) : val(x), next(nullptr) {} * }; */ class Solution { public: /*...
2025-12-26
0
19
题解 | 链表序列化
/** * struct ListNode { * int val; * struct ListNode *next; * ListNode(int x) : val(x), next(nullptr) {} * }; */ #include <vector> class S...
2025-12-26
0
17
题解 | 反转链表
/** * struct ListNode { * int val; * struct ListNode *next; * ListNode(int x) : val(x), next(nullptr) {} * }; */ class Solution { public: /*...
2025-12-26
0
16
题解 | 移除链表元素
/** * struct ListNode { * int val; * struct ListNode *next; * ListNode(int x) : val(x), next(nullptr) {} * }; */ class Solution { public: /*...
2025-12-26
0
21
题解 | 数颜色
#include <iostream> using namespace std; #include <string> int main() { string s; cin>>s; int a=0,b=0,d=0; for(char ...
2025-12-25
0
19
题解 | 小红和小紫的取素因子游戏
#include <chrono> #include <iostream> using namespace std; int count(int &x){ int cnt=0; if(x==1)return 0; while(x%2==0){ ...
2025-12-23
0
15
题解 | 小红与gcd三角形
#include <iostream> using namespace std; bool sanjiao(int a,int x,int y){ if(a+x>y&&a+y>x&&x+y>a)return true; e...
2025-12-23
0
14
首页
上一页
1
2
3
4
5
6
7
8
9
下一页
末页