牛客264479135号
牛客264479135号
全部文章
分类
题解(26)
归档
标签
去牛客网
登录
/
注册
牛客264479135号的博客
全部文章
(共19篇)
题解 | #求小球落地5次后所经历的路程和第5次反弹的高度#
n = int(input()) ground=n skip=0 def skip(n): return (1/2)**n*ground def total(n): t=0 for i in range(1,n): ...
Python3
2022-07-06
0
95
题解 | #整数与IP地址间的转换#
def ipto10(s): s = list(map(int,s.split('.'))) s=list(map(bin,s)) a=[] for i in s: &nbs...
字符串
Python3
2022-07-06
0
175
题解 | #查找两个字符串a,b中的最长公共子串#
a = input() b = input() ret = [] out = [] if len(a) > len(b): a, b = b, a left = right = 0 for right in range(1, len(a) + 1): while a[left:right] i...
Python3
2022-06-29
0
156
题解 | #字符串加解密#
def encryption(s: str): s = s out = '' for i in s: if i.isnumeric(): if int(i) < 9: out += str(int(i) + 1) else: out += str(0) if i.islower(): if i...
Python3
2022-06-28
0
175
题解 | #坐标移动#
location = input().split(';') row = 0 column = 0 pos = 'ADWS' while '' in location: location.pop(location.index('')) while location: value = location....
Python3
2022-06-26
0
140
题解 | #字符统计#
import collections s = list(input()) s.sort() d = collections.OrderedDict() for i in s: if i in d: d[i] += 1 else: d[i] = 1 for k, _ in sorted(d.items...
Python3
2022-06-25
0
160
题解 | #记负均正#
_,n = input(),list(map(int,input().split())) negative = [] positive = [] for i in n: if i <0: negative.append(i) elif i>0: positive.append(i) pr...
Python3
2022-06-25
0
112
题解 | #记票统计#
_, vote, _, people = input(), dict.fromkeys(input().split(),0), input(), input().split() vote.update({'Invalid':0}) for i in people: if i in vote: vot...
Python3
2022-06-25
0
137
题解 | #整型数组合并#
_, a1, _, a2 = (input(), input().split(), input(), input().split()) a = list(map(int,set(a1+a2))) # 转为int,便于排序 a.sort() print(''.join(list(map(str,a))...
Python3
2022-06-25
0
183
题解 | #尼科彻斯定理#
m = int(input()) j = [] n = m ** 3 for i in range(1, n + 1, 2): j.append(i) out = [] total = 0 for i in range(len(j) - 1): out.append(j[i]) total += j...
Python3
2022-06-25
0
167
首页
上一页
1
2
下一页
末页