题解列表

筛选

[编程入门]筛选N以内的素数题解

摘要:解题思路:先定义一个判断素数的函数,再从2到n去遍历,如果是素数,则输出。注意事项:素数判断从2写起,注意要小于等于。参考代码:#includeusing namespace std;bool ssp……

LETTERS(dfs)

摘要:解题思路:  因为涉及到回溯找最长的 所以最好用dfs递归注意事项: 多练就行了 没啥注意的参考代码:/*  3 6 HFDFFB AJHGDH DGAGEH  */ #include<i……

采用二进制移位法,循环一次即可

摘要:解题思路:采用二进制移位法,ABCDEF对应位状态为1是派出,0是留下。循环一次即可。注意事项:参考代码:#include<stdio.h>int main(){ int jieguo,max,num……

自然数的拆分(dfs)

摘要:解题思路:注意事项:参考代码:#include<iostream> #include<cstring> using namespace std; const int N=10010; int ……

C++ STL max_element

摘要:## max_element > 核心部分 `min_element(nums.begin()+r,nums.begin()+l+1)` ```c++ #include #inclu……

二级C语言-最小绝对值

摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int main(){    int a[10],i,min,min_i; for(……

注意头文件包含math.h

摘要:#include<stdio.h>#include<math.h>#define S(a,b,c) (a+b+c)*0.5#define area(S,a,b,c) sqrt(S*(S-a)*(S-b……