2060: [STL训练]美国大选【我来使用STL算法中的multiset来写一份题解】 摘要:解题思路:注意事项:参考代码:#include<iostream>#include<set>using namespace std;int main(void){ int i,temp; …… 题解列表 2022年08月23日 0 点赞 0 评论 1066 浏览 评分:0.0
[STL训练]Who's in the Middle:我看很多大佬都是用sort的,我来写一个使用STL中的multiset来实现的 摘要:解题思路:找到中间值注意事项:参考代码:#include<iostream> #include<set> using namespace std; int main(void) { …… 题解列表 2022年08月23日 0 点赞 0 评论 647 浏览 评分:0.0
绝对值排序(C语言)冒牌排序进行排列 摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<math.h>int main(){ int i,j,x,t; while(scanf("%d",&x)!…… 题解列表 2022年08月22日 0 点赞 0 评论 450 浏览 评分:0.0
质因数分解,很自然的思路 摘要:解题思路:把4个数都变成:质因数1^x1*质因数2^x2*质因数3^x3...然后进行讨论即可,对于同一个底数,假设4个数对应的指数(可以为0)分别为a,b,c,d。令x的指 …… 题解列表 2022年08月22日 0 点赞 0 评论 1162 浏览 评分:9.9
题解 1347: 八皇后(c++) ```cpp#includeusingnamespacestd;constintN=20;inta[N],n,ans=0;booltp[3][2*N];voiddfs(intu){if(u>n){ans++;if(ans>3)return;else{for(inti=1;i 题解列表 2022年08月22日 0 点赞 0 评论 1150 浏览 评分:9.9
个人思路,随便看看吧 摘要:解题思路:学会列表的相关操作很重要注意事项:参考代码:def fun(n): l1 = [n] while n != 1: if n % 2 == 0: …… 题解列表 2022年08月22日 0 点赞 0 评论 517 浏览 评分:0.0
编写题解 1121: C语言训练-8除不尽的数(笨办法) 根据题目要求,设置好判断条件(if语句),然后使用for循环(循环体中未设置判断条件),从大到小取数,代入进去尝试,直到遇到符合所有条件的数,使用break终止跳出循环,并且输出。```c//8除不尽的数#includevoidNum(){inti, 题解列表 2022年08月21日 0 点赞 0 评论 572 浏览 评分:0.0
入门级的莫队,时间复杂度O(n√n) 摘要:解题思路:入门级的莫队,不会的可以看看这篇莫队入门文章:https://www.cnblogs.com/WAMonster/p/10118934.html注意事项:参考代码:#include<bits…… 题解列表 2022年08月21日 0 点赞 0 评论 1032 浏览 评分:9.0
1023——————选择排序 #一行foriinsorted(list(map(int,input().split()))):print(i)#两行n=list(map(int,input().split()))foriinsorted(n):print(i)#三行n=list(map(int, 题解列表 2022年08月21日 0 点赞 0 评论 816 浏览 评分:9.9
密码(C语言) 摘要:解题思路:注意事项:比较简单,没什么好主意的参考代码:#include<stdio.h>#include<string.h>#include <ctype.h>#include<math.h>int …… 题解列表 2022年08月21日 0 点赞 0 评论 422 浏览 评分:0.0