牛客484960258号
牛客484960258号
全部文章
分类
题解(49)
归档
标签
去牛客网
登录
/
注册
牛客484960258号的博客
全部文章
(共47篇)
题解 | #走方格的方案数#
感觉是一个迭代啊 def func(x,y): if x < 0 or y < 0: return 0 elif x == 0 or y == 0: return 1 else: return func(x-1, y...
Python3
2021-11-23
38
3781
题解 | #求最大连续bit数#
def func(x): y = bin(x) for i in range(len(y),0,-1): n = ''.join(['1'] * i) if n in y: return i return 0 whil...
Python3
2021-11-22
0
312
题解 | #最长回文子串#
def func(x): for i in range(len(x),0,-1): for j in range(len(x)-i+1): if i % 2 == 0 and x[j:int(j+i/2)][::-1]==x[int(j+i/2):j+...
Python3
2021-11-22
0
397
题解 | #二维数组操作#
def create_table(x,y): if 0 < x <= 9 and 0 < y <= 9: global mytable mytable = [[i + j for j in range(y)] for i in rang...
Python3
2021-11-22
12
891
题解 | #尼科彻斯定理#
def myfunc(x): result = [] y = int(pow(x, 3) / x) if x % 2 == 0: for i in range(x//2): temp_1 = y - 1 - 2*i ...
Python3
2021-11-22
0
459
题解 | #公共子串计算#
def myfunc(x, y): for i in range(len(x),0,-1): for j in range(len(x)-i+1): if x[j:j+i] in y: return i retu...
Python3
2021-11-22
0
324
题解 | #参数解析#
while True: try: a = input() b = [] mark = [] for i in range(len(a)): if a[i] == """: mark.append(i) if len(mark) == 0: b = a.split() else: j = 0 k = ...
Python3
2021-11-22
0
368
首页
上一页
1
2
3
4
5
下一页
末页