AND20211201
AND20211201
全部文章
分类
dfs(1)
总结(28)
数据结构(1)
未归档(1)
洛谷(1)
题解(113)
归档
标签
去牛客网
登录
/
注册
AND20211201的博客
TA的专栏
17篇文章
0人订阅
未解决
2篇文章
297人学习
数据结构
15篇文章
377人学习
全部文章
(共149篇)
修改数组
">using namespace std; const int N = 1e6 + 1e5 + 10; int p[N]; int find(int x) // 并查集 { if (p[x] != x) p[x] = find(p[x]); return p[x]; } int ...
并查集
2022-03-21
1
268
扩展欧几里得算法
">#include<cmath> using namespace std; int exgcd(int a, int b, int &x, int &y) { if(!b) { x = 1, y = 0; return a; } int d = exgc...
C++
2022-03-18
1
319
字母组合
题目描述: 由 A,B,C 这3个字母就可以组成许多串。 比如:“A”,“AB”,“ABC”,“ABA”,“AACBB” … 现在,小明正在思考一个问题: 如果有a个A,b个B,c个C 字母,能组成多少个不同的长度为n的串呢? ">using namespace std; const int N =...
2022-03-18
1
425
X的因子链
要想求出严格递增且任意前面数可以整除后面数的因子序列,就要用到算术基本定理,先随便找一个质因子,然后序列的第二个数一定是前面的质因子再乘上另一个质因子,以此类推,序列最后一个数一定是所有质因子的乘积。所以,序列的长度是质因子的个数。排列的方式不一定是质因子个数的阶乘,因为在选择过程中,会有重复,比如...
2022-03-17
1
359
质数筛
质数筛可以在O(n)的时间复杂度求出1~n中所有的质数,并求出每个数的最小质因子 #include<iostream> #include<cstdio> using namespace std; const int N = 1e7 + 10; int p[N], cnt,...
2022-03-17
2
296
等差数列
#include<iostream> #include<algorithm> using namespace std; const int N = 1e5 + 10; int a[N];...
2022-03-16
1
193
大臣的旅费
#include<iostream> #include <vector> using namespace std; const int N = 1e5 + 10; typedef&nbs...
2022-03-15
1
269
全球变暖
#include<iostream> #include <queue> #define x first #define y second using namespace std; typedef ...
C++
广度优先搜索
2022-03-15
1
321
地牢大师
#include<iostream> #include<queue> #include<cstring> #include<cstdio> using namespace std; char s[110][110][110...
2022-03-14
0
290
完全二叉树的权值
#include<iostream> using namespace std; typedef long long LL; const int N = 1e5 + 10; LL&...
2022-03-14
0
342
首页
上一页
4
5
6
7
8
9
10
11
12
13
下一页
末页