叫啥名
叫啥名
全部文章
分类
归档
标签
去牛客网
登录
/
注册
叫啥名的博客
全部文章
(共102篇)
题解 | 截取字符串
#include <iostream> using namespace std; int main() { string s; int n; cin >> s >> n; cout << s.substr(0, n);//------...
2025-03-30
0
32
题解 | 构造C的歪
#include <iostream> using namespace std; int main() { int a, b; cin >> a >> b; cout << 2 * max(a, b) - min(a, b);...
2025-03-30
2
33
题解 | 尼科彻斯定理
#include <iostream> using namespace std; int main() { int n; cin >> n; //找规律 int stare = ((n/* - 1 + 1*/) * 1.0 / 2 * (n - ...
2025-03-30
0
30
题解 | 计算日期到天数转换
#include <array> #include <iostream> using namespace std; bool is_leap_year(int y){//-----------判断闰年 if (y % 400 == 0) return 1; if (y...
2025-03-30
0
49
题解 | 统计每个月兔子的总数
#include <iostream>//---------------模拟、动态规划 #include <array> using namespace std; array<array<int, 3>, 33> a{0};//------a【i】【j...
2025-03-26
0
38
题解 | 矩阵乘法
#include <iostream>//----------还没学矩阵算法,不知道有没有更快的思路,我用的是模拟 #include <vector> using namespace std; #define pre(var, stare, end) for(int var ...
2025-03-26
0
37
题解 | 查找两个字符串a,b中的最长公共子串
#include <iostream>//-----------我用的是枚举 using namespace std; #define pre(var, stare, end) for (int var = stare; var > end; var--) #define all(...
2025-03-24
0
51
题解 | 实现二叉树先序,中序和后序遍历
/** * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {...
2025-03-24
1
41
题解 | 【模板】拓扑排序
#include <bitset>//--------这是模板题 #include <iostream> #include <map> #include <queue> #include <vector> using namespace s...
2025-03-24
0
51
题解 | 高精度整数加法
#include <iostream> using namespace std; class strnum{ private: int hcf_dvqi(string& s1, string& s2){//-------------使两个数组一样长,并在前面加一个0防...
2025-03-24
0
38
首页
上一页
2
3
4
5
6
7
8
9
10
11
下一页
末页