佛系的青年
佛系的青年
全部文章
分类
归档
标签
去牛客网
登录
/
注册
佛系的青年的博客
全部文章
(共89篇)
题解 | 仰望水面的歪
将折射的光线以水面为对称 反转上去 刚好z的位置应该射到2*h-z 用int后面几个例子过不去 需要改成long #include <iostream> #include <vector> using namespace std; //欧几里得算法求最大公约数 long ...
2025-03-10
6
48
题解 | 将真分数分解为埃及分数
列出数学式子然后递归 大佬nb 注意int改成long 不然最后一组数据会溢出 #include<iostream> #include<string> using namespace std; int main(){ long a, b; //分别是分子分母 ...
2025-03-10
0
37
题解 | 字符串字符匹配
#include <iostream> #include <vector> using namespace std; int main() { vector<int> alpha(26, 0); string s, t; cin >...
2025-03-10
0
25
题解 | 整型数组合并
利用set 自动去重+排序 好用的不得了 #include <iostream> #include <set> #include <vector> using namespace std; int main() { int n, m; cin &...
2025-03-10
0
25
题解 | 火车进站
回溯法 #include <iostream> #include <vector> #include <stack> #include <algorithm> using namespace std; vector<vector<int&...
2025-03-09
0
40
题解 | 尼科彻斯定理
第一个数+最后一个数 = n平方的二倍 第一个数比最后一个数小2倍的n-1,可以推导第一个数和n的关系:n*n * 2 = begin + begin + (n-1)*2 -> begin = n*n - n + 1; #include <iostream> #include &l...
2025-03-08
0
28
题解 | 公共子串计算
#include <iostream> #include <vector> using namespace std; int main() { string s, t; cin >> s >> t; int m = s.siz...
2025-03-08
0
31
题解 | 参数解析
定义一个bool变量 判断是否在引号里面 #include <iostream> #include <vector> using namespace std; int main() { string command, tmp; vector<stri...
2025-03-08
0
32
题解 | 计算日期到天数转换
xiao hai mo ji ga #include <iostream> #include <vector> using namespace std; int main() { int year, month, day; cin >> year...
2025-03-07
0
40
题解 | 百钱买百鸡问题
纯暴力解法,满足价钱100 数量也100即可 #include <iostream> using namespace std; int main() { int cock, hen, chick; for(cock = 0; cock <= 20; ++cock)...
2025-03-07
0
38
首页
上一页
1
2
3
4
5
6
7
8
9
下一页
末页