牛客484960258号
牛客484960258号
全部文章
分类
题解(49)
归档
标签
去牛客网
登录
/
注册
牛客484960258号的博客
全部文章
(共47篇)
题解 | #字符个数统计#
a = input().strip() b = [] for i in a: if ord(i) >=0 and ord(i) <= 127: b.append(i) else: pass c = list((dict.fromkeys...
Python3
2021-11-23
0
643
题解 | #合并表记录#
a = int(input()) names = [] values = [] for i in range(a): x = input() m, n = x.split() if m in names: values[names.index(m)] += ...
Python3
2021-11-23
0
455
题解 | #进制转换#
def myfunction(x): abc = [] if x <= 1: return [] i = 2 count = 0 while i*i <= x: if x % i == 0: ...
Python3
2021-11-23
3
648
题解 | #截取字符串#
while True: try: string = input() number = int(input()) print(string[:number]) except: break
Python3
2021-11-23
0
420
题解 | #百钱买百鸡问题#
a = input() for i in range(21): for j in range(34): if (100 - 5*i - 3*j)*3+i+j == 100: print(i,j,100-i-j)
Python3
2021-11-23
0
364
题解 | #密码强度等级#
def count_char(x): count = 0 for i in range(len(x)): if x[i].isalpha(): count += 1 return count def count_digits(x): ...
Python3
2021-11-23
0
400
题解 | #求最小公倍数#
def func(x,y): k = 1 for i in range(min(x, y),0,-1): if x % i == 0 and y % i == 0: k = i return x*y/k retu...
Python3
2021-11-23
0
378
题解 | #单词倒排#
a = input() for i in a: if not i.isalpha(): a = a.replace(i,' ') b = a.split() print(*b[::-1])
Python3
2021-11-23
120
10202
题解 | #等差数列#
def func(a0,d,n): an = a0 + (n - 1) * d return (a0 + an)/2*n while True: try: a = int(input()) b = func(2,3,a) pr...
Python3
2021-11-23
0
503
题解 | #记负均正#
while True: try: a = int(input()) b = list(map(int,input().split())) b.sort() while 0 in b: b.remove(0...
Python3
2021-11-23
0
289
首页
上一页
1
2
3
4
5
下一页
末页