BFS模版题(很模版) ```cpp#includeusingnamespacestd;typedefpairPII;constintN=1000;intn,end_day;charroom[N][N];queueq1;queueq2;intans;intX[]={0, 题解列表 2024年05月30日 0 点赞 0 评论 632 浏览 评分:0.0
BFS最短路+超简单思路+清晰代码 摘要:解题思路:求最优路径一般考虑bfs,直接使用队列。队列中元素使用pair,因为还需要记录步数。就是简单入队出队的遍历。注意事项:参考代码:#include <bits/stdc++.h> using…… 题解列表 2024年05月28日 1 点赞 0 评论 624 浏览 评分: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 评论 520 浏览 评分:8.0
线段树变式+维护区间前8大的值 解题思路:线段树是很常见的数据结构,不会的同学可以自行百度学习。首先题意有两种操作,一个是修改值,一个是查询区间[a,b]的第8大的值。我们使用线段树结构,每个节点存储这个区间的前八位的值,这里不用建树,大家都是0。关键就是怎么让孩子节点的值传递到父节点, 题解列表 2024年05月27日 0 点赞 0 评论 497 浏览 评分: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 评论 460 浏览 评分:0.0
编写题解 2828: 与7无关的数 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;bool bsq(int n) { for(int i=1;i<=n;i++) { …… 题解列表 2024年05月26日 0 点赞 0 评论 455 浏览 评分:0.0
编写题解 1022: [编程入门]筛选N以内的素数 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;bool ss(int n) { for(int i=2;i<n;i++) { …… 题解列表 2024年05月26日 0 点赞 0 评论 439 浏览 评分:0.0
编写题解 2820: 含k个3的数 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int jgs(int n) { int j=0;while(n){if(n%10=…… 题解列表 2024年05月26日 0 点赞 0 评论 514 浏览 评分:0.0
编写题解 2818: 分离整数的各个数位 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int main(){long long a; cin>>a;while(a){co…… 题解列表 2024年05月26日 0 点赞 0 评论 604 浏览 评分:0.0
题解 2042: 杨辉三角 摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;typedef long long ll;const ll N =1e3;ll a…… 题解列表 2024年05月26日 0 点赞 0 评论 616 浏览 评分:0.0