杰出的小新
杰出的小新
全部文章
分类
题解(13)
归档
标签
去牛客网
登录
/
注册
杰出的小新的博客
全部文章
(共13篇)
题解 | #统计大写字母个数#
python 正则表达式 一行代码 import re while True: try: print(len(re.findall(r'[A-Z]', input()))) except: break
2021-08-16
2
315
题解 | #求最大连续bit数#
python 一行 while True: try: print(len(max(bin(int(input()))[2:].split('0'),key=len))) except: break
2021-08-16
11
644
题解 | #字符统计#
python 字典+sorted while True: try: dic = {} for i in input(): if i in dic: dic[i] += 1 else...
2021-08-15
0
285
题解 | #记负均正II#
用whilt True 来读取while(cin>>)读入,直接在while True里判断 negative = 0 positive = 0 sum_p = 0 while True: try: nums = input() if int(nu...
2021-08-15
0
319
题解 | #输出单向链表中倒数第k个结点#
python 定义节点类和链表类 #定义节点类 class list_node(): def __init__(self,value,next_node=None): self.value = value self.next_node = next_node ...
2021-08-13
1
435
题解 | #从单向链表中删除指定值的节点#
python 正规单向链表写法,定义节点类,定义链表类 #定义节点类 class list_node(): def __init__(self,value,next_node=None): self.value = value self.next_node =...
2021-08-13
2
543
题解 | #迷宫问题#
python + 递归 def find_path(maze,current,path,all_path): temp = path.copy() temp.append(current) if current[0] == len(maze)-1 and current[1]...
2021-08-12
0
323
题解 | #字符串加解密#
数字分为 000(billion),000(million),000(thound),000 四段,three_digit 函数输出每一段的表达,function函数把四段链接起来 def three_digit(string): dic1 = {'1':'one','2':'two','...
2021-08-12
1
387
题解 | #字符串加解密#
python 利用ASCII码+1或者-1操作进行子母编码或解码status值为1表示编码,-1表示解码 def encryption(password,status): result = '' for char in password: #数字位 i...
2021-08-09
2
436
题解 | #查找兄弟单词#
python while True: try: line = input().split() num = int(line[0]) initial = line[1:num+1] word = line[-2] ...
2021-08-08
1
394
首页
上一页
1
2
下一页
末页