daydayup牛
daydayup牛
全部文章
分类
题解(97)
归档
标签
去牛客网
登录
/
注册
daydayup牛的博客
全部文章
(共15篇)
题解 | #判断两个IP是否属于同一子网#
这个掩码判断合法性有点难度,我已经忘了补码了,计组太恶心了。用了bitset模板 #include <algorithm> #include <vector> #include <bitset> #include <cmath> #include &l...
C++
字符串
2022-03-30
0
366
题解 | #学英语#
这道题的思路就是三个三个的处理,根据题目要求实现就行了 #include <algorithm> #include <vector> #include <map> using namespace std; vector<string> v = { ...
C++
字符串
2022-03-30
0
405
题解 | #DNA序列#
暴力法,遍历找就可以了 #include <algorithm> using namespace std; int main() { string str; while(getline(cin,str)){ int k; cin>...
C++
字符串
2022-03-30
0
380
题解 | #配置文件恢复#
一次AC我是真的没想到啊,可恶。这道题就是有点弯弯绕绕,但你仔细分析发现它只是不停if else #include <algorithm> #include <sstream> #include <map> using namespace std; int m...
C++
字符串
2022-03-30
0
365
题解 | #表示数字#
我的无脑插入法,懒得拷贝了,直接输出 #include <algorithm> using namespace std; int main() { string str; while(getline(cin,str)){ int i ...
C++
字符串
2022-03-29
1
332
题解 | #密码强度等级#
一次AC,这是我没想到的,无限if else #include <algorithm> using namespace std; int main() { string str; while(getline(cin,str)){ int sum = 0...
C++
字符串
2022-03-29
0
403
题解 | #统计大写字母个数#
#include <algorithm> using namespace std; int main() { string str; while(getline(cin,str)){ int k=0; int n = str.size(...
C++
字符串
2022-03-29
0
340
题解 | #截取字符串#
#include <algorithm> using namespace std; int main() { string str; while(getline(cin,str)){ int k; cin>>k; ...
C++
字符串
2022-03-29
0
317
题解 | #查找两个字符串a,b中的最长公共子串#
压缩一下,空间复杂度一下就降下来了,不停的更新每一行就行了,把短的字符串弄到第一行。 其实可以看出有公共子串其实就是矩阵里不为0的位置连在一起。 ```#include <iostream> #include <algorithm> #include <vector&...
C++
动态规划
字符串
2022-03-25
0
364
题解 | #查找两个字符串a,b中的最长公共子串#
暴力解,时间复杂度O(N^3),空间复杂度O(1) #include <algorithm> using namespace std; int main() { string str1,str2; while(cin>>str1>>str2){...
C++
字符串
2022-03-25
0
291
首页
上一页
1
2
下一页
末页