牛客396959330号
牛客396959330号
全部文章
分类
归档
标签
去牛客网
登录
/
注册
牛客396959330号的博客
全部文章
(共11篇)
题解 | 字符串的全部子序列 递归
class Solution { public: string path; unordered_set<string>set;//去重 vector<string>ans; int n; void f(string s,int dep)...
2024-12-24
0
33
题解 | 线段重合 小根堆
#include <iostream>//O(NlogN) #include <queue> #include<algorithm> using namespace std; priority_queue<int,vector<int>,grea...
2024-12-21
0
57
题解 | 合并k个已排序的链表 小根堆
/** * struct ListNode { * int val; * struct ListNode *next; * ListNode(int x) : val(x), next(nullptr) {} 构造函数 * }; */ #include <queue> #in...
2024-12-21
0
35
题解 | 计算数组的小和 归并分治
#include <iostream>//O(NlogN) using namespace std; int a[100005],t[100005],n; long long mergesort(int l,int m,int r){ long long ans=0,sum=0;...
2024-12-21
0
39
题解 | 大雨吃小鱼 单调栈
#include <iostream> using namespace std; int n,a[100005],st[100005][2],s,ans; int main() { cin>>n; for(int i=1;i<=n;i++){ ...
2024-12-16
0
48
题解 | 单调栈结构(进阶)
#include <bits/stdc++.h> using namespace std;//用数组实现栈 int n, a[1000005], l[1000005], r[1000005], st[1000005]/*手写栈*/, s,cur;//O(N) int main() { ...
2024-12-15
0
48
题解 | 机器人跳跃问题 二分答案法
#include <iostream> using namespace std; int n,a[100005],l,r,ans,ma; bool check(int m,int max){ for(int i:a){ if(m>=max)return tr...
2024-12-15
0
40
题解 | #【模板】二维差分#第2版
#include <iostream> typedef long long ll; using namespace std; ll n, m, q, b[1005][1005], x1, y1, x2, y2, k, tmp; void diff(int x1, int y1, int...
2024-12-12
0
28
题解 | #【模板】二维差分#
#include <iostream> typedef long long ll; using namespace std; ll n, m, q, a[1005][1005],b[1005][1005], x1, y1, x2, y2, k; int main() { cin ...
2024-12-12
0
32
题解 | #未排序数组中累加和为给定值的最长子数组系列问题补1#前缀和
#include <iostream> #include <unordered_map> using namespace std; int n,presum,a[100005],st,ma; unordered_map<int,int>hmap; int main...
2024-12-11
0
37
首页
上一页
1
2
下一页
末页