走迷宫—BFS广度优先搜索 摘要:定义char g[][]为迷宫,把n行m列的迷宫输入进去,通过bfs广度优先搜索来找到从(1,1)到(n。m)的最短路径,在定义数组的时候是从(0,0)开始的所以要找到(0,0)到(n-1,m-1)的…… 题解列表 2023年10月14日 0 点赞 0 评论 711 浏览 评分:9.9
最简洁的代码 摘要:解题思路:def factor_sum(y): divisors = [i for i in range(1, y) if y % i == 0] return sum(divis…… 题解列表 2023年10月14日 1 点赞 0 评论 670 浏览 评分:9.9
结构体之时间设计(简单C语言) 摘要:解题思路:1月到12月没什么规律,所以用个数组来累加,累加玩后在month>=3月开始判断是闰年与否,是的话sum++注意事项:参考代码:#include<stdio.h>#include<stdli…… 题解列表 2023年10月14日 0 点赞 0 评论 366 浏览 评分:0.0
列方程,巨简单 摘要:for n in range(1, 10**10): if ((((n-1)/8)-1)/8-7)/8*2 == (((n-4)/17)-15)/17: print(n) …… 题解列表 2023年10月14日 0 点赞 0 评论 434 浏览 评分:8.0
查找特定的值 摘要:解题思路:首先通过scanf获取数据,接着对给定的一串数据,通过数组记录,开始获取的数据即为数组长度,再由这个数组长度来声明数组,并通过循环遍历给数据赋值,至此已经获得了一串代找数据,然后先给一共变量…… 题解列表 2023年10月14日 0 点赞 0 评论 580 浏览 评分:0.0
电报加密(C语言) 摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<string.h>int main(){ char a[100]; gets(a); int i; …… 题解列表 2023年10月14日 1 点赞 0 评论 410 浏览 评分:0.0
电池的寿命(极简版) 摘要:解题思路:虽然这道题被划到贪心,但至今没觉得哪里体现了贪心的思想。一开始我用分治的思想:把整个list分成长度不大于3的若干组,计算每组的使用时间和剩余时间,使用时间叠加到总时间tz,然后剩余时间相当…… 题解列表 2023年10月14日 0 点赞 0 评论 817 浏览 评分:6.0
c语言代码解决问题 摘要:解题思路:注意事项:#include<stdio.h>#include<string.h>#include<stdlib.h>typedef struct student{ char id[21]; …… 题解列表 2023年10月13日 0 点赞 0 评论 703 浏览 评分:0.0
c语言代码解决问题 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int gcd(int a, int b){ int temp; while (a % b != 0) { temp = a % b;…… 题解列表 2023年10月13日 0 点赞 0 评论 461 浏览 评分:0.0
题解 2819:数字反转 摘要:解题思路:注意事项:参考代码:import java.util.Scanner;public class Main { public static void main(String[] args…… 题解列表 2023年10月13日 0 点赞 0 评论 515 浏览 评分:0.0