牛客596495425号
牛客596495425号
全部文章
分类
归档
标签
去牛客网
登录
/
注册
牛客596495425号的博客
全部文章
(共74篇)
题解 | abc
#include<stdio.h> #include <iostream> using namespace std; int main() { for (int a = 0; a < 9; a++) { for (int b = 0; b <...
2025-03-14
0
11
题解 | 最小邮票数
#include <iostream> #include<cstring> using namespace std; //本题就是一个01背包问题 const int N = 25; const int inf = 0x3f3f3f3f; int v[N]; int f[11...
2025-03-14
0
12
题解 | 玛雅人的密码
#include <iostream> #include<map> #include<queue> //这题应该时用bfs因为要在转换后的数字上接着交换 using namespace std; map<string, int>find_str; in...
2025-03-14
0
13
题解 | 最大上升子序列和
#include <iostream> using namespace std; const int N = 1010; int a[N]; int f[N]; int main() { int n; while(cin>>n){ for(in...
2025-03-12
0
15
题解 | 最大子矩阵
#define _CRT_SECURE_NO_WARNINGS #include<iostream> using namespace std; const int N = 110; int graph[N][N]; int s[N][N];//保存每一列的前缀和 int main() ...
2025-03-12
0
19
题解 | 最长公共子序列(一)
#define _CRT_SECURE_NO_WARNINGS #include<iostream> using namespace std; //公共子序列的经验就是用f[i][j]代表公共子序列在数组a中从前i个元素选,在数组b中从前j个元素中选 //由于是求最值所以重复没关系 /...
2025-03-12
0
28
题解 | Freckles
//有些时候不要太死板了,数据结构复杂的情况下,想存关系并不是非得用复杂的结构体来索引,可以都存入数组中,用数组下标即int类型来索引 #include<iostream> #include<vector> #include<algorithm> #include...
2025-03-10
0
17
题解 | 继续畅通工程
#include<iostream> #include<vector> #include<algorithm> using namespace std; const int N = 110; int p[N];//保存所有结点的状态 struct edge { ...
2025-03-10
0
15
题解 | Head of a Gang
#include<iostream> #include<unordered_map> #include<string> #include<map> #include<vector> using namespace std; const in...
2025-03-10
0
16
题解 | 找出直系亲属
#include<iostream> //由题目可以发现一个人一个父亲一个母亲,并不符合并查集合的用一个数组来存 //并且也要注意到如果用两个数组来存即两个并查集的话,在查找一个元素是否是另外一个元素的父母时非常的麻烦 //因为他的曾祖母可能是其父亲的母亲或者是其母亲的母亲存在交叉关系根...
2025-03-09
0
12
首页
上一页
1
2
3
4
5
6
7
8
下一页
末页