叫啥名
叫啥名
全部文章
分类
归档
标签
去牛客网
登录
/
注册
叫啥名的博客
全部文章
(共81篇)
题解 | 构造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
25
题解 | 尼科彻斯定理
#include <iostream> using namespace std; int main() { int n; cin >> n; //找规律 int stare = ((n/* - 1 + 1*/) * 1.0 / 2 * (n - ...
2025-03-30
0
21
题解 | 计算日期到天数转换
#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
26
题解 | 统计每个月兔子的总数
#include <iostream>//---------------模拟、动态规划 #include <array> using namespace std; array<array<int, 3>, 33> a{0};//------a【i】【j...
2025-03-26
0
28
题解 | 矩阵乘法
#include <iostream>//----------还没学矩阵算法,不知道有没有更快的思路,我用的是模拟 #include <vector> using namespace std; #define pre(var, stare, end) for(int var ...
2025-03-26
0
23
题解 | 查找两个字符串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
34
题解 | 实现二叉树先序,中序和后序遍历
/** * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {...
2025-03-24
1
27
题解 | 【模板】拓扑排序
#include <bitset>//--------这是模板题 #include <iostream> #include <map> #include <queue> #include <vector> using namespace s...
2025-03-24
0
28
题解 | 高精度整数加法
#include <iostream> using namespace std; class strnum{ private: int hcf_dvqi(string& s1, string& s2){//-------------使两个数组一样长,并在前面加一个0防...
2025-03-24
0
28
题解 | 【模板】链表
#include <iostream> using namespace std; class node{//---------节点(一个数字,和一个指向下一节点的指针,指向空表示其为尾节点 public: int n; node* next; node(int x){ ...
2025-03-22
0
32
首页
上一页
1
2
3
4
5
6
7
8
9
下一页
末页