题解列表

筛选

编写题解 2943: Vigenère密码

解题思路:输入-小写转换大写-密文转明文-大写转为小写输出注意事项:套用公式用于大写字母,输出时保留大小写,所以用f[i]标记小写字母;如果k密钥长度不够,用(i%k_len)求;公式:m[i]=c[i]-(k[i%k_len]-65);明文=密文-(密钥-65)参考代码:#include

自由下落的距离计算

##我的代码```pythonm,n=map(int,input().strip().split())a=0b=m#这里将b的初值设为m,因为落下距离容易被忽略,也可以不写,然后在format(1000+b)foriinrange(1,n+1):a=m/pow(2,

c语言代码解决问题

摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<stdlib.h>int main(){    int n, * a,i,plateau_length=1,max_p……

c语言代码解决问题

摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<string.h>#include<ctype.h>int main(){    char str[1001];   ……

简单易懂C语言

摘要:#include<stdio.h> int main() { int a = 1, b = 1; int n; scanf("%d", &n); if(n==1){ ……

利用递归算法求解猴子吃桃问题

#利用递归算法求解猴子吃桃问题##我的代码```pythonfromfunctoolsimportlru_cache@lru_cache(maxsize=1024)#python在运行递归的时候每次取值都会计算一次这样运行速度就十分的缓慢#但是如果我们将结果放到缓存那么就可以大大提高它的运行速度def

筛选N以内的素数

#我的代码```pythonnum=int(input())list=[]foriinrange(2,num+1):forjinrange(2,i):if(i%j==0):breakelse:list.append(i)foriinrange(len(list)):print(list[i])```#