题解列表

筛选

筛选n以内的完数 c语言

摘要:解题思路:用两个for循环来做,第一个for循环用来从一到n,第二个for循环用来判断是不是素数如果取余为零则说明是因子注意事项:参考代码:#include <stdio.h>int main(){ ……

用for放高度

摘要:解题思路:注意事项:参考代码:#include<stdio.h>void main(){ int i=0; int apple=0; int hig[10]; int sh; for(;i<10;i+……

用python写个bfs

摘要:解题思路:注意事项:参考代码:#飞机降落,bfs枚举T = int(input())sj = [[(0,0,0)] for _ in range(T)]for i in range(T):    n ……

组合数的DFS+剪枝

```importjava.util.Scanner;publicclassMain{staticintn;staticintk;staticintres=0;//x表示数//c表示还需要分几份//start表示下次至少分多少staticvoiddfs(intx,

深度搜索DFS

```importjava.util.Scanner;publicclassMain{staticintN=10;staticintn;//边长staticintk;//棋子数staticchar[][]g=newchar[N][N];//记录棋盘staticboolean[]st=newboolea

分解质因数

摘要:解题思路:注意事项:可以不考虑是否是素数,直接对其分解不推荐gotoloop,我只是当时就只想到了gotoloop参考代码:#include<stdio.h>int main(){ long  a,b……

纸张尺寸(C++)

摘要:#include<iostream> using namespace std; int main() {     int index = 0;     string paper_type……