AND20211201
AND20211201
全部文章
题解
dfs(1)
总结(28)
数据结构(1)
未归档(1)
洛谷(1)
归档
标签
去牛客网
登录
/
注册
AND20211201的博客
全部文章
/ 题解
(共113篇)
KMP算法
来自专栏
next[i] = j的含义是: 字符串中的[1, j] 和 [i - j + 1, i]是相等的,并且长度最大。 #include<iostream> using namespace std; const int N = 1e6 + 10; char s[N], p[N]; int ...
2022-05-09
1
298
The least round way
#include<bits/stdc++.h> using namespace std; const int N = 1100; typedef pair<int, int> PII; int a[N][N]; int f[N][N][3]; int main() { i...
2022-05-06
1
264
镜子
#include<bits/stdc++.h> using namespace std; const int N = 1000; struct Mirror{ int a, b; char c; }q[N]; int n; int dy[4] = {1, 0, -1, 0...
2022-05-04
1
233
礼物
">#include<algorithm> using namespace std; const int N = 1e3 + 10; #define x first #define y second pair<int,int> a[N]; int b[N]; int cmp(...
2022-05-04
0
197
干草
#include<iostream> using namespace std; const int N = 10010; int a[N]; int main() { int n, sum = 0; cin >> n; int are = 0; ...
2022-05-03
1
233
比赛时间
#include<iostream> using namespace std; int main() { int a, b, c; cin >> a >> b >> c; if(a < 11){ print...
2022-05-02
1
243
奶牛赛跑
#include<iostream> using namespace std; const int N = 2 * 1e6 + 10; int a[N], b[N]; int main() { int n, m; cin >> n >> m; ...
2022-04-29
0
255
见面与问候
1.两头牛一秒移动一单位长度,所以在两头牛均在移动时,它们所在单位奇偶性是一致的。这意味这两头牛一定不会在某个单位格中间相遇。 2.如果可以在中间相遇(这题不考虑),可以将运动的距离乘以二,这样就可以只枚举整点。 C++ #include<iostream> using namespac...
2022-04-29
1
370
信息中继
#include<iostream> using namespace std; const int N = 1010; int a[N], b[N], p[N], s[N]; int find(int x) { if(p[x] != x)p[x] = find(p[x]); ...
2022-04-27
0
343
重新排列奶牛
C++ #include<bits/stdc++.h> using namespace std; const int N = 1e6 + 10; int a[N], b[N], p[N], s[N]; int find(int x) { if(p[x] != x)p[x] = f...
2022-04-26
1
292
首页
上一页
1
2
3
4
5
6
7
8
9
10
下一页
末页