1096扫雷(构建两个数组,for循环遍历实现) 摘要:解题思路:注意事项:参考代码:#include#includeusing namespace std;int main(){ int m, n; int k = 1;//后面输出第几组数据用的 whi…… 题解列表 2024年05月31日 0 点赞 0 评论 165 浏览 评分:0.0
全网最简单思路,简单代码+排序相除即可 摘要:解题思路:首先求等比数列最大比例,题目会给出一个等比数列的子序列。1、先从大到小排序,然后计算每一项与后一项的比例,取最小的比例就是题目要求的了。证明很简单,任意项之间的比值都为q^x,只要找到都能满…… 题解列表 2024年05月31日 0 点赞 0 评论 276 浏览 评分:6.0
为何正确率如此低? 摘要:```cpp #include using namespace std; const int N=1e6+10; int a[N]; int k,n; void dfs(int …… 题解列表 2024年05月30日 0 点赞 0 评论 331 浏览 评分:0.0
编写题解 1022: [编程入门]筛选N以内的素数 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;bool qsh(int n) { for(int i=2;i<n;i++) {…… 题解列表 2024年05月30日 0 点赞 0 评论 408 浏览 评分:0.0
编写题解 2832: 第n小的质数 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;bool zs(int n){ for(int i=2;i<n/2+1;i++) {…… 题解列表 2024年05月30日 0 点赞 0 评论 177 浏览 评分:0.0
BFS模版题(很模版) 摘要: ```cpp #include using namespace std; typedef pair PII; const int N=1000; int n,end_day; c…… 题解列表 2024年05月30日 0 点赞 0 评论 219 浏览 评分:0.0
BFS最短路+超简单思路+清晰代码 摘要:解题思路:求最优路径一般考虑bfs,直接使用队列。队列中元素使用pair,因为还需要记录步数。就是简单入队出队的遍历。注意事项:参考代码:#include <bits/stdc++.h> using…… 题解列表 2024年05月28日 0 点赞 0 评论 241 浏览 评分:9.9
编写题解 2817: 级数求和 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int main(){int k,i=1;double s=0;cin>>k;whi…… 题解列表 2024年05月27日 1 点赞 0 评论 165 浏览 评分:8.0
线段树变式+维护区间前8大的值 摘要:解题思路:线段树是很常见的数据结构,不会的同学可以自行百度学习。首先题意有两种操作,一个是修改值,一个是查询区间[a,b]的第8大的值。我们使用线段树结构,每个节点存储这个区间的前八位的值,这里不用建…… 题解列表 2024年05月27日 0 点赞 0 评论 182 浏览 评分:9.9
编写题解 2823: 计算分数加减表达式的值 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int main(){int n;double s=0;cin>>n;for(int…… 题解列表 2024年05月27日 0 点赞 0 评论 157 浏览 评分:0.0