题解列表
关键点 不能重复计算
摘要:n=int(input())def rec(cur,n): global res for x in range(cur,n): if n%x==0 and n//x>=x: ……
1031: [编程入门]自定义函数之字符串反转
摘要:解题思路:运用for循环从后往前遍历即可注意事项:参考代码:#include<stdio.h>#include<string.h>void f(char a[100]){ for(int i=s……
#不固定行数的读入,使用栈 python
摘要:#不固定行数的读入# s=input()ss=[]# while s!='':# ss.append(s)# s=input()#不固定行数的读入import sysI……
floyd算法,代码简介明了
摘要:解题思路:注意事项:参考代码:#include<iostream>#include<cstring>#include<algorithm>using namespace std;const int N……
汽水瓶----最简单的解法(容易理解+详解)
摘要:解题思路:1、通过while循环来模拟兑换的过程2、用sum变量记录总共可兑换的瓶数3、一次循环就是进行一轮兑换4、本轮可进行兑换的空瓶子数n 除以3,就是本轮兑换到的瓶数,并加给n和sum5、再计算……
邻接矩阵求最短路,代码简单,建议学懂原理之后来看这个代码,非常清晰
摘要:解题思路:注意事项:堆优化更好,不过本题不使用对优化的原因是本题直接给邻接矩阵,方便参考代码:#include <iostream>#include <algorithm>#include <cstr……
1915: 蓝桥杯算法提高VIP-三个整数的排序
摘要:解题思路:注意事项:参考代码:#include<iostream>
using namespace std;
int main()
{
int arr[3];
for(int……
1872: 春夏秋冬季节判断
摘要:解题思路:注意事项:参考代码:#include<iostream>
using namespace std;
int main()
{
int n;
cin>>n;
……