a天河朔夜a
a天河朔夜a
全部文章
分类
归档
标签
去牛客网
登录
/
注册
a天河朔夜a的博客
全部文章
(共72篇)
题解 | #合并两个有序的数组#
class Solution { public: void merge(int A[], int m, int B[], int n) { vector<int>p; int l=0,r=0; while(l<m&&r<...
2023-04-05
0
208
题解 | #判断是否为回文字符串#
class Solution { public: bool judge(string str) { int l=0,r=str.length()-1; while(l<r) { if(str[l]!=str[r])...
2023-04-05
0
250
题解 | #合并区间#
bool cmp(Interval a,Interval b) { return a.start<b.start; } class Solution { public: vector<Interval> merge(vector<Interval> &i...
2023-04-05
0
180
题解 | #最小覆盖子串#
int resl,resr; string res=""; int mi = 0x3f3f3f3f; unordered_map<char, int>ss; unordered_map<char, int>tt; set<char>fl; class Soluti...
2023-04-05
0
300
题解 | #反转字符串#
class Solution { public: string solve(string str) { int k=str.length()-1; string m=""; while(k>=0)m+=str[k--]; ...
2023-04-05
0
202
题解 | #最长无重复子数组#
class Solution { public: int maxLength(vector<int>& arr) { int l = 0, r = 0, res = 0; set<int>has; while (r ...
2023-04-05
0
228
题解 | #盛水最多的容器#
class Solution { public: int maxArea(vector<int>& height) { int res=0,l=0,r=height.size()-1; while(l<r) { ...
2023-04-05
0
247
题解 | #接雨水问题#
#define ll long long class Solution { public: ll maxWater(vector<int>& arr) { ll res=0; int l=0,r=arr.size()-1; whil...
2023-04-05
0
254
题解 | #数组中的逆序对#
#define ll long long #define lowbit(x) x&(-x) #define mod 1000000007 vector<int>a, t, d; bool cmp(int x, int y) { return a[x] == a[y] ? x &g...
2023-04-03
0
283
题解 | #二叉树中的最大路径和#
#include <bits/stdc++.h> using namespace std; vector<pair<int,vector<int>>>d(1010); int n,k,ma=0xc0c0c0c0; int dfs(int k) { ...
2023-03-20
0
320
首页
上一页
1
2
3
4
5
6
7
8
下一页
末页