讲义气的勇士愿offer多多
讲义气的勇士愿offer多多
全部文章
分类
归档
标签
去牛客网
登录
/
注册
讲义气的勇士愿offer多多的博客
TA的专栏
4篇文章
0人订阅
字符串操作
4篇文章
92人学习
全部文章
(共110篇)
题解 | #矩阵乘法#
// 分为三大步处理 #include <iostream> #include <vector> using namespace std; int main() { // 1. 先把两个二维数组都读进来 int x, y, z; cin >&g...
2024-09-30
0
79
题解 | #成绩排序#
#include <algorithm> #include <iostream> #include <vector> using namespace std; // 自定义比较函数 struct user{ string name; int sco...
2024-09-30
0
63
题解 | #MP3光标位置#
// 利用数组 array<int,4> dq{0}; 来模拟菜单 #include <array> #include <deque> #include <iostream> using namespace std; int main() { ...
2024-09-30
0
77
题解 | #DNA序列#
// 利用滑动窗口的解法,效率更高 #include<iostream> #include<string> using namespace std; int main() { string s; int n; while (cin >> ...
2024-09-30
0
73
题解 | #DNA序列#
// 暴力解法 #include <iostream> using namespace std; int main() { string str; int n; cin >> str >>n; string subStr, ans...
2024-09-30
0
65
题解 | #找出字符串中第一个只出现一次的字符#
#include <array> #include <iostream> using namespace std; // 先遍历一遍数组,利用26个元素的数组来存放每个单词出现的次数 // 第二次再遍历一次数组,找到第一个出现一次的字符 int main() { ...
2024-09-29
0
93
题解 | #输入n个整数,输出其中最小的k个#
// 暴力解法。对数据进行排序,取前几个元素 #include <algorithm> #include <array> #include <iostream> #include <vector> using namespace std; int m...
2024-09-29
0
75
题解 | #高精度整数加法#
// 大数问题,用字符串来模拟加法运算,主要考虑进位情况 #include <algorithm> #include <iostream> #include <string> using namespace std; int main() { strin...
2024-09-29
0
63
题解 | #完全数计算#
// 优化一下:函数perfect里面的for循环只遍历到 n/2。 #include <iostream> using namespace std; bool perfect(int n){ int sum = 0; for(int i = 1; i <= n/2...
2024-09-29
0
76
题解 | #完全数计算#
// 从1遍历到n,如果满足完全数的条件,cnt就加一 #include <iostream> using namespace std; bool perfect(int n){ int sum = 0; for(int i = 1; i < n; ++i){ ...
2024-09-29
0
55
首页
上一页
2
3
4
5
6
7
8
9
10
11
下一页
末页