AND20211201
AND20211201
全部文章
分类
dfs(1)
总结(28)
数据结构(1)
未归档(1)
洛谷(1)
题解(113)
归档
标签
去牛客网
登录
/
注册
AND20211201的博客
TA的专栏
17篇文章
0人订阅
未解决
2篇文章
297人学习
数据结构
15篇文章
377人学习
全部文章
(共149篇)
社交距离I
">using namespace std; const int N = 1e5 + 10; int p[N]; int main() { int n; string s; cin >> n >> s; int cnt = 0; for...
2022-03-28
0
403
三角形
">#include<algorithm> using namespace std; const int N = 110; pair<int,int> a[N]; #define x first #define y second int main() { int n;...
2022-03-27
0
240
困牛放牧
">#include<algorithm> using namespace std; int a[3]; int main() { for(int i = 0; i < 3; i ++)cin >>a[i]; sort(a, a + 3); in...
2022-03-27
0
341
连通块中 点的数量
">using namespace std; const int N = 1e5 + 10; int p[N], len[N]; int find(int x)//返回x的祖宗节点 + 路径压缩 { if(p[x]!=x) p[x] = find(p[x]); return p[x]...
2022-03-26
1
301
并查集
来自专栏
并查集支持的操作: 将两个集合合并 询问两个元素是否在一个集合当中 基本原理:每一棵树用树根来表示,树根的编号就是整个集合的编号。每个节点储存它的父节点,p[x]表示x的。父节点。 问题一: 如何判断树根?当p[x] == x时,p[x]为根节点。 问题二:如何求x的集合编号?...
2022-03-25
1
317
整数拼接
">using namespace std; const int N = 1e5 + 10; typedef long long LL; int a[N]; LL s[11][N]; int main() { LL n, k; cin >> n >>k; ...
2022-03-24
1
227
走方格
">using namespace std; int n, m; int t[100][100]; int ans; int dx[] ={1,0}, dy[] = {0, 1}; int dfs(int st, int ed) { for(int i = 0; i < 2; i ++...
动态规划
2022-03-24
1
203
牛的学术圈
">#include<algorithm> using namespace std; const int N = 1e5 + 10; int c[N]; int n, l, h; typedef pair<int, int> PII; #define x first #def...
2022-03-24
0
262
池塘计数
">#include<queue> using namespace std; #define x first #define y second int n, m; const int N = 1010; char s[N][N]; bool t[N][N]; int ans; typed...
2022-03-23
1
457
倍数问题
来自专栏
">#include <vector> #include<algorithm> #include<cstring> using namespace std; const int N = 1e3 + 10; vector<int> a[N]; int f...
2022-03-22
1
293
首页
上一页
3
4
5
6
7
8
9
10
11
12
下一页
末页