1389: 程序员的表白 摘要:C++处理字符串真方便#include <bits/stdc++.h> using namespace std; void print(int &n){ string border …… 题解列表 2022年01月11日 0 点赞 0 评论 303 浏览 评分:0.0
1084: 用筛法求之N内的素数。 摘要:筛法求素数。筛法比我之前自己想的那种判断方法要快许多。(判断素数基本可以用筛法往上套)#include <bits/stdc++.h> using namespace std; void ju…… 题解列表 2022年01月11日 0 点赞 0 评论 316 浏览 评分:0.0
1770: [编程入门]链表之报数问题 摘要:约瑟夫环问题。用循环链表解决。(也可以直接用公式法递推)#include <bits/stdc++.h> using namespace std; typedef int ElementTy…… 题解列表 2022年01月11日 0 点赞 0 评论 310 浏览 评分:0.0
汽水瓶递归解题思路(c++) 摘要:解题思路: 首先,题目这里说的是每三瓶可以换一瓶,在这里我看到的人第一想法就是,用这个数去除三,得到的数再去除三,这一个反复的过程,但是如果是偶数的话他会多出一瓶,所以我的出的公式是(n/3)+…… 题解列表 2022年01月11日 0 点赞 0 评论 680 浏览 评分:9.9
递归方法实现括号匹配-正则问题 摘要:```cpp #include #include #include using namespace std; string s; int pos=0; int dfs(){ i…… 题解列表 2022年01月11日 0 点赞 0 评论 469 浏览 评分:9.9
stl,你值得拥有 摘要:解题思路:使用两个容器进行合并,算法什么的直接用就好了,注意包含头文件注意事项:参考代码:#include <iostream>#include <vector>#include <algorithm…… 题解列表 2022年01月10日 0 点赞 0 评论 385 浏览 评分:0.0
45错误解决措施-快速幂 摘要:解题思路: 快速幂注意事项: 原数据先mod再进行快速幂运算参考代码:#includeusing namespace std; int main(){ long long b,…… 题解列表 2022年01月10日 0 点赞 0 评论 450 浏览 评分:9.5
他装的是散货!-快乐司机 摘要:解题思路: 贪心+单位价值排序注意事项:他装的是散货!他装的是散货!他装的是散货!参考代码:#include#includeusing namespace std; struct huo{ …… 题解列表 2022年01月10日 0 点赞 0 评论 784 浏览 评分:9.9
瞧一瞧看一看简单易懂童叟无欺-纪念品分组 摘要:参考代码: #include<bits/stdc++.h> using namespace std; int w,n,ans=0; int a[30005]; int main(){ …… 题解列表 2022年01月10日 0 点赞 2 评论 213 浏览 评分:7.3
算法也太难了吧-防御力 摘要:参考代码:#include using namespace std; struct nodea{ int id,w; } a[100005];struct nodeb{ …… 题解列表 2022年01月09日 0 点赞 0 评论 525 浏览 评分:9.9