2864: 单词替换 摘要:解题思路:1.读入一行字符串s、待替换单词a和替换单词b。2.使用stringstream将字符串s分割成单词,并依次判断每个单词是否为待替换单词a,若是,则输出替换单词b;否则输出原单词。3.输出替…… 题解列表 2023年04月21日 0 点赞 0 评论 254 浏览 评分:10.0
2863: 删除单词后缀 摘要:解题思路:1.读入一个字符串2.循环判断是否以er、ly、ing结尾3.如果是则使用erase()函数进行删除即可注意事项:参考代码:#include <iostream> #include <cs…… 题解列表 2023年04月21日 0 点赞 0 评论 322 浏览 评分:0.0
2862: 字符串移位包含问题 摘要:解题思路: 核心思路时解决唯一问题,在这里采用了把比较长的字符串增加一倍的方法来解决位移问题,如:样例s1=AABCD s2=CDAA两个s1即 AABCDAABCD,如果s2在这个字符串中,即输出t…… 题解列表 2023年04月20日 0 点赞 0 评论 270 浏览 评分:0.0
最长回文串马拉车算法(Manacher) 摘要:解题思路: 假设输入字符串为 S ① 题目关键点在于 s′ = s ⊕ rev(s) 可以字符串 s 进行一次该公式反转,然后再前后拼接 01 ,生成目标字符串 S …… 题解列表 2023年04月20日 0 点赞 0 评论 750 浏览 评分:9.9
2857: 加密的病历单 摘要:解题思路:注意事项:参考代码:#include <iostream> #include <cstring> #include <algorithm> using namespace std; …… 题解列表 2023年04月20日 0 点赞 0 评论 194 浏览 评分:0.0
编写题解 1097: 蛇行矩阵 不理解就找我 嘎嘎简单 摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int main(){ int n = 0; int a[20][20] = { 0 }; i…… 题解列表 2023年04月20日 0 点赞 0 评论 206 浏览 评分:0.0
编写题解 1670: 拆分位数 摘要:解题思路:方法一:我们可以定义一个字符串。注意事项:参考代码:#include<iostream> using namespace std; string n; int main() { …… 题解列表 2023年04月19日 0 点赞 0 评论 418 浏览 评分:9.9
1670: 拆分位数 摘要:解题思路:wu注意事项:wu参考代码:#include<iostream>using namespace std;int main(){ int n; cin>>n; cout<<n…… 题解列表 2023年04月19日 0 点赞 0 评论 219 浏览 评分:9.9
tarjan算法求lca 摘要:# 代码 ```cpp #include #include #include #include #include #include #include #include …… 题解列表 2023年04月19日 0 点赞 0 评论 827 浏览 评分:4.7
Tom数的题解 为什么老说我标题短 摘要:解题思路:字符串注意事项:无参考代码:#include <iostream>#include<string.h>using namespace std;int main(){ int sum =…… 题解列表 2023年04月19日 0 点赞 0 评论 304 浏览 评分:9.9