牛客511199982号
牛客511199982号
全部文章
分类
题解(33)
归档
标签
去牛客网
登录
/
注册
牛客511199982号的博客
全部文章
(共26篇)
题解 | #DNA序列#
while True: try: s = input() zclen = int(input()) slen = len(s) GCR = 0 result = [0,''] for i in range(slen): teststr = s[i:zclen+i] ...
Python3
2021-12-09
0
271
题解 | #蛇形矩阵#
#用递归的思路,算出第一行 1+2+3+。。。。+n def func(n): if n == 1: return 1 else: return func(n-1) + n def func2(n): return n-1 while True: try: num = int(input()) #先...
Python3
2021-12-09
1
437
题解 | #配置文件恢复#
while True: try: strlist = input().split() l = len(strlist) key = ["reset", "reset board", "board add", "board delete", "reboot backplane", "backplane...
Python3
2021-12-09
0
217
题解 | #合法IP#
while True: try: s = input().split('.') result = 'YES' if len(s) != 4: print('NO') else: for i in s: if not i.isdigit() or (i.startswith('0') and len(...
Python3
2021-12-08
0
186
题解 | #最长回文子串#
1.第一步,循环找到正序和倒叙都一样的子串(回文字符串特点就是正序和倒叙一致) 2.在这部分字串中,筛选出回文字串(特点:首尾字符相同) 3.筛选出来的回文字串,字符串长度大于m,才更新m while True: try: s1 = input() #正序字符串 s2 = s1[::-1] #倒序...
Python3
2021-12-07
3
474
题解 | #尼科彻斯定理#
while True: try: n=int(input()) start = n*n-n+1 s = '' for i in range(0,n): s = s + str(start) + '+' start+=2 print(s.rstrip('+')) except: break
Python3
2021-12-07
0
175
首页
上一页
1
2
3
下一页
末页