高天翱翔666
高天翱翔666
全部文章
分类
题解(3)
归档
标签
去牛客网
登录
/
注册
高天翱翔666的博客
全部文章
(共36篇)
题解 | 大整数哈希
#include<bits/stdc++.h> #define U unsigned long long using namespace std;U n,x,y,i,S;unordered_map<U,U>M; int main(){for(cin>>n;cin&...
2025-08-18
0
17
题解 | 字符串哈希
#include<bits/stdc++.h> using namespace std; int main(){set<string>S;string s; for(cin>>s;cin>>s;)S.insert(s);cout<<...
2025-08-18
0
10
题解 | 两数之和
class Solution { public: vector<int> twoSum(vector<int>&N,int T){map<int,int>M;int i=0; for(;i<N.size()&&...
2025-08-18
0
13
题解 | 插队
#include<bits/stdc++.h> using namespace std;int n,m; int main(){list<string>l;map<string,list<string>::iterator>M;string x,y; ...
2025-08-18
0
17
题解 | 判断一个链表是否为回文结构
class Solution { public: bool isPail(ListNode*h) { int a[100005],l=0,i=0; for(;h;h=h->next)a[l++]=h->val; for(;i<...
2025-08-18
0
15
题解 | 链表相交
#include <bits/stdc++.h> using namespace std; int main() { int a,b,c;cin>>a>>b>>c; if(c<1)cout<<"null&qu...
2025-08-18
0
10
题解 | 链表相交
ListNode *getIntersectionNode(ListNode*A,ListNode*B) { ListNode*a=A,*b=B;while(a!=b)a=a?a->next:B,b=b?b->next:A; return a; } 极简的代码
2025-08-18
0
15
题解 | 合并两个排序的链表
class Solution { public: ListNode*Merge(ListNode*h,ListNode*H){ return h?H?h->val<H->val?(h->next=Merge(h->next,H),h):(H-&g...
2025-08-18
0
19
题解 | 反转链表
class Solution { public: ListNode* ReverseList(ListNode*h){ListNode*k=h; if(h&&h->next)k=ReverseList(h->next),h->next->...
2025-08-18
0
20
题解 | 移除链表元素
class Solution { public: ListNode*removeElements(ListNode* h, int v) { return h&&(h->next=removeElements(h->next,v),h->va...
2025-08-18
0
13
首页
上一页
1
2
3
4
下一页
末页