牛客857079027号
牛客857079027号
全部文章
分类
未归档(1)
题解(60)
归档
标签
去牛客网
登录
/
注册
牛客857079027号的博客
全部文章
(共52篇)
题解 | #MP3光标位置#
没通过全部用例 while True: try: a = int(input()) b = input() pl = [] for i in range(a): pl.a...
Python3
2021-12-18
0
322
题解 | #挑7#
while True: try: a = int(input()) res = [] for i in range(7, a+1): if i%7==0:#7的倍数 res.append(...
Python3
2021-12-18
1
268
题解 | #输入整型数组和排序标识,对其元素按照升序或降序进行排序#
while True: try: a = input() b = map(int,input().split()) #需要整型才能正确排序 c = int(input()) if c==0: ...
Python3
2021-12-18
0
284
题解 | #求最小公倍数#
from functools import reduce a, b = map (int, input().split()) c = [1] #初始化 for i in range(2, min(a,b)+1):#不能从1开始否则下面的循环条件永远成立 while a%i==0 and b%...
Python3
2021-12-18
0
308
题解 | #求最小公倍数#
简单但超时... a, b = map (int, input().split()) res = [] for n in range(1, a*b+1): if n%a==0 and n%b==0: res.append(n) print(min(res))
Python3
2021-12-18
0
347
题解 | #等差数列#
while True: try: n = int(input()) a1=2 d= 3 s = n*a1+n*(n-1)*d/2 print(int(s)) except: break
Python3
2021-12-18
3
624
题解 | #求最大连续bit数#
while True: try: a = int(input()) b = bin(a) c = str(b) res = [0] for i in range(2, len(c)): f...
Python3
2021-12-18
0
271
题解 | #统计大写字母个数#
while True: try: a = input() res = 0 b = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T'...
Python3
2021-12-18
1
310
题解 | #计算日期到天数转换#
如果是整百年,需要被400整除才是闰年,不是整百年被4整除就是闰年 a = input() b, c, d = map(int,a.split(' ')) def m(b,c,d): if c == 1: print(d) elif c == 2: ...
Python3
2021-12-17
0
335
题解 | #查找组成一个偶数最接近的两个素数#
while True: try: a = int(input()) b = [] #质数判断 def prime(n): s = [] for i in rang...
Python3
2021-12-17
0
381
首页
上一页
1
2
3
4
5
6
下一页
末页