随笔分类 -  算法与数据结构

摘要:日志统计 #include<iostream> #include<algorithm> using namespace std; const int N=1e5+10; #define x first #define y second typedef pair<int,int> PII; int n 阅读全文
posted @ 2021-04-05 21:00 RowryCho 阅读(92) 评论(0) 推荐(0)
摘要:连号区间数 #include<bits/stdc++.h> using namespace std; const int N = 1e4+10,INF=1<<30; int q[N]; int res; int main(){ int n; cin >> n; for(int i=0;i<n;i++ 阅读全文
posted @ 2021-04-05 12:14 RowryCho 阅读(101) 评论(0) 推荐(0)
摘要:买不到的数目 暴力做法 #include<bits/stdc++.h> using namespace std; int n,m; bool check(int x){ for(int i=0;i<=x/n;i++){ for(int j=0;j<=x/m;j++){ int t=i*n+j*m; 阅读全文
posted @ 2020-12-05 10:21 RowryCho 阅读(106) 评论(0) 推荐(0)
摘要:数的范围 #include<bits/stdc++.h> using namespace std; const int N=100000+10; int q[N]; int n,t; int bsearch1(int x,int l,int r){ while(l<r){ int mid=l+r>> 阅读全文
posted @ 2020-11-29 09:43 RowryCho 阅读(155) 评论(0) 推荐(0)
摘要:递归实现指数型枚举 #include<iostream> using namespace std; const int N=15+10; bool st[N]; int n; void dfs(int u){ if(u>n){ for(int i=1;i<=n;i++){ if(st[i])cout 阅读全文
posted @ 2020-11-22 12:43 RowryCho 阅读(162) 评论(0) 推荐(0)
摘要:github地址 蓝桥杯训练 github地址 递归与递推 | 01 递归与递推 | 01 二分与前缀和 | 02 二分与前缀和 | 02 数学与简单DP | 03 数学与简单DP | 03 枚举,模拟与排序 | 04 枚举,模拟与排序 | 04 树状数组与线段树 | 05 双指针,BFS与图论 | 阅读全文
posted @ 2020-11-22 12:42 RowryCho 阅读(114) 评论(0) 推荐(0)