一只菜弱鸡
一只菜弱鸡
全部文章
题解
未归档(3)
归档
标签
去牛客网
登录
/
注册
一只菜弱鸡的博客
全部文章
/ 题解
(共62篇)
题解 | #DNA序列#
#include<bits/stdc++.h> using namespace std; string GCmax(string str, int n) { vector<s...
C++
2022-04-25
0
258
题解 | #整数与IP地址间的转换#
#include <iostream> using namespace std; int main() { unsigned int a,b,c,d; long&nbs...
C++
2022-04-25
9
249
题解 | #在字符串中找出连续最长的数字串#
/*在字符串中找到最长的数字串*/ /*思路:老办法,先正则出所有的数字串存起来,并记录最长长度, 最后根据这个长度输出符合要求的数字串*/ #include <bits/stdc++.h> using namespace std; ...
C++
2022-04-24
0
437
题解 | #放苹果#
放苹果分为两种情况,一种是有盘子为空,一种是每个盘子上都有苹果。 令f(m,n)表示将m个苹果放入n个盘子中的摆放方法总数。 1.假设有一个盘子为空,则f(m,n)问题转化为将m个苹果放在n-1个盘子上,即求f(m,n-1) 2.假设所有盘子都装有苹果,则每个盘子上至少有一个苹果,即最多剩下m-n个...
C++
2022-04-24
2
371
题解 | #完全数计算#
#include <iostream> using namespace std; int main() { int n; cin>>n; int ...
C++
2022-04-24
0
215
题解 | #汽水瓶#
#include <iostream> using namespace std; int soda(int n) { int num; &nbs...
C++
2022-04-24
0
243
题解 | #迷宫问题#
菜人只会BFS ... 这个题要注意的地方是从(0,0)开始,所以终止点坐标是输入的行列数-1 #include <string> #include <iostream> #include <queue> u...
C++
2022-04-24
0
415
题解 | #字符串加解密#
#include <bits/stdc++.h> using namespace std; //加密 string Encrypt(string str) { string s&n...
C++
2022-04-23
0
388
题解 | #密码截取#
//马拉车+1 #include <bits/stdc++.h> using namespace std; string Manacher(string tmp) { string&nbs...
C++
2022-04-23
0
364
题解 | #走方格的方案数#
不能往上或者往右,所以只要到了最底或最右的边上,便只有一条路走到终点了。 #include <iostream> using namespace std; int stepnums(int x, int y) { &...
C++
2022-04-23
0
328
首页
上一页
1
2
3
4
5
6
7
下一页
末页