题解列表

筛选

编写题解 2830: 数字统计

摘要:解题思路:注意事项:参考代码:l,r=map(int,input().split())times=0for i in range (l,r+1):    times+=str(i).count(&#3……

编写题解 2829: 数1的个数

摘要:解题思路:注意事项:参考代码:n=int(input())times=0for i in range (1,n+1):    times+=str(i).count('1')print……

编写题解 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:     ……

3019: 约瑟夫问题 python自带库实现

摘要:解题思路:使用python自带库,collections中的deque,队列实现retate(n)是将队列中的所有元素向右移动n位,如果是负数,则向左移动例如:dq = [1, 2, 3, 4, 5]……

高效素数判断方法以及取模公式

摘要:解题思路:本体采用的取模公式为a*b%c=((a%c)*(b%c))%c,求前n个质数的积对于50000的模,就相当于每一次与质数相乘后对于50000取模,然后再与下一个质数相乘,再取模,相乘取模的步……

三国游戏 贪心算法

摘要:# 三国游戏n = int(input())a= list(map(int,input().split()))b = list(map(int, input().split()))c = list(m……

编写题解 1861: 程序员爬楼梯

摘要:解题思路:类似于斐波那契数列不过递推公式为:F(n) = F(n -1) + F(n - 3)注意事项:参考代码:n = int(input())dp = [1, 1, 2, 3]#dp[i] 中 i……

1068: 二级C语言-温度转换

摘要:解题思路:注意事项:参考代码:def ctof(i):    print('c=%d->f=%d'%(i,32 + i* 9/5))for i in range(-100,151,5)……