一只菜弱鸡
一只菜弱鸡
全部文章
题解
未归档(3)
归档
标签
去牛客网
登录
/
注册
一只菜弱鸡的博客
全部文章
/ 题解
(共62篇)
题解 | #括号匹配深度#
遇到'(' n+1,遇到')'n-1,出现过最大的n就是所求深度了 #include <iostream> #include <string> using namespace std; int main () { string str; cin>>str...
C++
2022-04-18
0
278
题解 | #称砝码#
#include <bits/stdc++.h> using namespace std; int main () { int n; cin >> n; int weight[10],nums[10]; //最多10种砝码 for(int i =...
C++
2022-04-18
0
254
题解 | #尼科彻斯定理#
#include <iostream> #include <sstream> using namespace std; int main() { int i, n; cin >> i; n = i; int data = 1; string s,str; ...
C++
2022-04-17
0
281
题解 | #名字的漂亮度#
数组储存每个字母出现的次数,从大到小排序,依次乘以26,25,24,....,0,求和。 #include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; string st...
C++
2022-04-17
0
411
题解 | #字符串加密#
#include <bits/stdc++.h> using namespace std; int main () { string str, input, keystr; cin >> str; cin >> input; //去重,新...
C++
2022-04-17
4
291
题解 | #兄弟单词HJ27#
思路简单直接:要满足兄弟的要求,长度要与之相等,且内容不能相同(重要!),且且二者排序后相等的就是兄弟了。 #include <string> #include <string.h> #include <iostream> #include <vector&...
C++
2022-04-16
1
534
题解 | #删除字符串中出现次数最少的字符#
将每个字符出现的次数(顺便找出最小的次数)建立map<字符,次数>,用map里value最小的key去比对str,相同则删除,输出剩下的str。 #include <iostream> #include <algorithm> #include <map&g...
C++
2022-04-15
0
435
题解 | #字符串排序#
#include <iostream> using namespace std; int main() { string str; char zm[1000]; int n = 0; getline(cin,str); for(int i = 0; i < ...
C++
2022-04-15
0
298
题解 | #单词倒排#
读入一行字符串,正则遍历找出符合要求的子串,压入栈,输出(出栈)直到栈空。 #include <iostream> #include <string> #include <regex> #include <stack> using namespace ...
C++
2022-04-15
1
318
题解 | #图片整理#
#include<bits/stdc++.h> using namespace std; int main() { string str; while(cin>>str){ sort(str.begin(),str.end()); cout...
C++
2022-04-15
0
289
首页
上一页
1
2
3
4
5
6
7
下一页
末页