AND20211201
AND20211201
全部文章
题解
dfs(1)
总结(28)
数据结构(1)
未归档(1)
洛谷(1)
归档
标签
去牛客网
登录
/
注册
AND20211201的博客
全部文章
/ 题解
(共113篇)
Dijkstra求最短路 I
来自专栏
#include<bits/stdc++.h> using namespace std; const int N = 510, M = 1e5 + 10; int n, m; int dist[N];//存储每个点到1号点的最短距离 bool st[N];//表示每个点的最短路是否确定 ...
C++
2022-09-27
0
377
火车进栈
">using namespace std; int n, cnt = 20; vector<int>st3; stack<int>st2; int st1 = 1; void dfs() { if(!cnt)return ; if(st3.size() == n )...
2022-09-18
0
309
树的重心
#include<bits/stdc++.h> using namespace std; const int N = 1e5 + 10, M = 2 * N; int h[N], e[M], ne[M], idx; int ans = N , n; bool st[N]; void a...
2022-09-08
1
286
CF-Qpwoeirut And The City
如果n为奇数,那只有一种情况,就是从2开始间隔一个,到n - 1结束。如果n为偶数,则可能从2开始,也可能从3开始(无论从哪开始都到n - 1结束),还可能是两种情况的混合(在某一段从高低高低到高低底高) #include<bits/stdc++.h> using namespace s...
2022-07-19
1
286
CF-Making Towers
正确代码: #include<bits/stdc++.h> using namespace std; #define x first #define y second const int N = 2e5 + 10; typedef long long LL; typedef pair&l...
2022-07-19
1
418
CF. Mark and His Unfinished Essay
对于巨长的字符串复制后进行查询可以逐层向上推导前一次复制所在的位置,复制前所在的位置等于复制的字符串在当前字符串的左端点减去复制的字符串在没有复制之前的字符串左端点的位置 #include<bits/stdc++.h> using namespace std; #define x fir...
2022-07-18
0
316
CF. Schedule Management
#include<bits/stdc++.h> using namespace std; const int N = 2e5 + 10; typedef long long LL; int a[N]; int n , m; map<int, LL>mp; bool check...
2022-07-15
1
337
一排奶牛
求只包含两个数的区间里的最大值 #include<iostream> using namespace std; const int N = 1e6 + 10; int a[N]; int cnt[N]; int main() { int n; cin >> n...
2022-06-07
0
265
字符串哈希
来自专栏
不能把数字映射成0,因为一个A是0,两个A也是0,会冲突。 #include<iostream> #include<cstring> typedef unsigned long long ULL; const int N = 1e5 + 10, P = 131; ULL p[...
哈希函数
2022-05-17
1
326
Trie树
来自专栏
Trie树是用来快速存储和查找字符串集合的数据结构 #include<iostream> using namespace std; const int N = 1e6; int n; int son[N][26];//26为存储字符的个数 int cnt[N];//以当前字符结尾的单词...
2022-05-09
1
272
首页
上一页
1
2
3
4
5
6
7
8
9
10
下一页
末页