题解列表
[编程入门]完数的判断
摘要:解题思路:记录遍历中的每一个因子的和进行判断就行,遍历因子的时候为了减小时间复杂度,可以遍历到当前数的开平方,但是这时需要b.append(a//i)注意事项:a % i == 0时还得b.appen……
2829: 数1的个数
摘要:解题思路:注意事项:致 别吃张博维giegie参考代码:#include <bits/stdc++.h>using namespace std;int main(){ long long n,s……
题解 1234: 检查一个数是否为质数
摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int main(){ int n; cin>>n; for(in……
1234: 检查一个数是否为质数(改进速度版)
摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;int main(){ long long n; cin>>n; ……
绝对值排序(动态内存分配(calloc)
摘要:解题思路:注意事项:参考代码#include<stdio.h>#include<stdlib.h>int main(){ int i,j,n,*p,*t; scanf("%d",&n); while(……
2604: 蓝桥杯2021年真题-砝码称重(unordered_set)
摘要:##unordered_set
**又学到了一个重要的数据结构!!
unordered_set:用于存放无序、不重复的数据(重复数据会被自动过滤)
set:用于存放有序、不重复的数据
unor……
1347: 八皇后 dfs回溯
摘要:解题思路:dfs注意事项:参考代码:import java.util.Scanner;public class nKingM { static int res = 0; public st……
信息学奥赛一本通T1453-移动玩具(广度搜索)
摘要:解题思路:注意事项:参考代码:#include<iostream>#include<cmath>#include<algorithm>#include<queue>using namespace st……