题解列表
编写题解 1022: [编程入门]筛选N以内的素数
摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;bool qsh(int n) { for(int i=2;i<n;i++) {……
编写题解 2832: 第n小的质数
摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;bool zs(int n){ for(int i=2;i<n/2+1;i++) {……
BFS模版题(很模版)
摘要:
```cpp
#include
using namespace std;
typedef pair PII;
const int N=1000;
int n,end_day;
c……
BFS最短路+超简单思路+清晰代码
摘要:解题思路:求最优路径一般考虑bfs,直接使用队列。队列中元素使用pair,因为还需要记录步数。就是简单入队出队的遍历。注意事项:参考代码:#include <bits/stdc++.h>
using……
编写题解 2817: 级数求和
摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int main(){int k,i=1;double s=0;cin>>k;whi……
线段树变式+维护区间前8大的值
摘要:解题思路:线段树是很常见的数据结构,不会的同学可以自行百度学习。首先题意有两种操作,一个是修改值,一个是查询区间[a,b]的第8大的值。我们使用线段树结构,每个节点存储这个区间的前八位的值,这里不用建……
编写题解 2823: 计算分数加减表达式的值
摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int main(){int n;double s=0;cin>>n;for(int……
编写题解 2828: 与7无关的数
摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;bool bsq(int n) { for(int i=1;i<=n;i++) { ……
编写题解 1022: [编程入门]筛选N以内的素数
摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;bool ss(int n) { for(int i=2;i<n;i++) { ……