题解列表

筛选

简易广搜代码(不用队列,只调用数组)

摘要:解题思路:与普通广搜不同,这里要统计步数,因此我们存储移动路径的数组要多一行,存储到这一位置所需的步数,即h[x][3]注意事项:参考代码:#include<bits/stdc++.h>using n……

简易广搜代码(不用队列,只调用数组)

摘要:解题思路:首先找到第一个非零数字,细胞数加一,再用bfs遍历,把所有非零数字变成0,这就是一个细胞。再继续寻找细胞,按以上步骤重复。注意事项:参考代码:#include<bits/stdc++.h>u……

2791: 计算邮资

摘要:解题思路:注意事项:参考代码:#include<iostream> #include<cmath> #include<iomanip> using namespace std; int mai……

2790: 分段函数

摘要:解题思路:注意事项:参考代码:#include<iostream> #include<iomanip> using namespace std; int main() {     doubl……

2789: 骑车与走路

摘要:解题思路:注意事项:参考代码:#include<iostream> using namespace std; int main() {     int meter;     cin>>met……

[编程入门]Sn的公式求和

摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){    int n,a,b,Sn;    b=1;    a=2;    Sn=0;    scanf("%d",……

.......................

摘要:解题思路:注意事项:参考代码:n=int(input())m=int(input())l={}for i in range(1,n+1):    sum1=0    for j in str(i): ……

.......................

摘要:解题思路:注意事项:参考代码:l={0:[1189,841]}for i in range(1,10):    l[i]=[l[i-1][1],l[i-1][0]//2]n=int(input()[1……

1020c语言代码

摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int N,i,s=1; scanf("%d",&N); for(i=N-1;i>0;i--){ s=(s+1……