一行输入,简单简单入门 摘要:解题思路:注意事项:参考代码:three_list = [list(map(int, input().split())) for _ in range(3)]for i in range(3): …… 题解列表 2024年03月04日 0 点赞 0 评论 549 浏览 评分:9.9
编写题解 2831: 画矩形 摘要:解题思路:注意事项:参考代码:h,w,c,flag=map(str,input().split())h=int(h)w=int(w)flag=int(flag)if flag==1: for i…… 题解列表 2024年03月04日 0 点赞 0 评论 484 浏览 评分:0.0
编写题解 2830: 数字统计 摘要:解题思路:注意事项:参考代码:l,r=map(int,input().split())times=0for i in range (l,r+1): times+=str(i).count(…… 题解列表 2024年03月04日 0 点赞 0 评论 555 浏览 评分:0.0
编写题解 2829: 数1的个数 摘要:解题思路:注意事项:参考代码:n=int(input())times=0for i in range (1,n+1): times+=str(i).count('1')print…… 题解列表 2024年03月04日 0 点赞 0 评论 586 浏览 评分:0.0
编写题解 2828: 与7无关的数 摘要:解题思路:注意事项:参考代码:n=int(input())sum=0for i in range(1,n+1): if i%7!=0 and i%10!=7 and i//10!=7: …… 题解列表 2024年03月04日 0 点赞 0 评论 607 浏览 评分:0.0
3019: 约瑟夫问题 python自带库实现 解题思路:使用python自带库,collections中的deque,队列实现retate(n)是将队列中的所有元素向右移动n位,如果是负数,则向左移动例如:dq=[1,2,3,4,5]数到3,应该3先出队列,总体向左移动m-1(也就是2位)。 题解列表 2024年03月04日 0 点赞 0 评论 548 浏览 评分:0.0
高效素数判断方法以及取模公式 解题思路:本体采用的取模公式为a*b%c=((a%c)*(b%c))%c,求前n个质数的积对于50000的模,就相当于每一次与质数相乘后对于50000取模,然后再与下一个质数相乘,再取模,相乘取模的步骤替换为上述公式右边的步骤,这样简化了计算过程的复杂度, 题解列表 2024年03月04日 0 点赞 0 评论 763 浏览 评分:9.9
编写题解 1120: C语言训练-"水仙花数"问题2 摘要:解题思路:list comprehension注意事项:参考代码:[print(f'{b*100+s*10+g}') for b in range(1,10) for s in ran…… 题解列表 2024年03月03日 0 点赞 0 评论 476 浏览 评分:0.0
三国游戏 贪心算法 #三国游戏n=int(input())a=list(map(int,input().split()))b=list(map(int,input().split()))c=list(map(int,input().split()))defsjfs(country, 题解列表 2024年03月03日 0 点赞 0 评论 1336 浏览 评分:9.3
编写题解 1141: C语言训练-百钱百鸡问题 摘要:解题思路:注意事项:参考代码:for i in range(20): for j in range (33): for k in range (100): i…… 题解列表 2024年03月03日 0 点赞 0 评论 602 浏览 评分:0.0