牛客8008419号
牛客8008419号
全部文章
分类
题解(24)
归档
标签
去牛客网
登录
/
注册
牛客8008419号的博客
全部文章
(共23篇)
题解 | #从单向链表中删除指定值的节点#
```while True: try: arr = list(map(int, input().split(' '))) arr_fst = arr[1] arr_lst = arr[2:-1] arr_del = arr[-1...
Python3
2021-12-18
0
370
题解 | #字符逆序#利用list(input())的特性,2行代码搞定
```while True: try: s = list(input()) print(''.join(s[::-1])) except: break
Python3
2021-12-17
2
1125
题解 | #判断两个IP是否属于同一子网#
```def checkip(lst): for i in lst: if int(i) < 0 or int(i) > 255: return False return True def checkmask(lst): i...
Python3
2021-12-17
0
382
题解 | #记负均正II#try except的理解很重要
try 里面写的是不断获取输入的数值 一旦输入结束,相当于不再满足循环的条件,则跳出该循环,开始打印输出 ```arr1 = [] arr2 = [] while True: try: n = int(input()) if n > ...
Python3
2021-12-17
1
827
题解 | #记票统计#
```while True: try: n1 = int(input()) arr1 = list(input().split()) n2 = int(input()) arr2 = list(input().split()) ...
Python3
2021-12-17
0
501
题解 | #火车进站#
```res = [] def dfs(wait, stack, out): if not wait and not stack: res.append(' '.join(map(str, out))) if wait: dfs(wait[1:], ...
Python3
2021-12-17
1
563
题解 | #求小球落地5次后所经历的路程和第5次反弹的高度#
```while True: try: row1, col, row2 = int(input()), int(input()), int(input()) lst1, lst2 = [], [] for i in range(row1): ...
Python3
2021-12-16
4
473
题解 | #提取不重复的整数#
```while True: try: s = input() tmp = [] for i in reversed(range(len(s))): if s[i] not in tmp: ...
Python3
2021-12-16
1
481
题解 | #公共子串计算#动态规划法
```def solution(s1, s2): mxlen = 0 dp = [[0 for i in range(len(s2)+1)] for j in range(len(s1)+1)] for i in range(len(s1)): for j i...
Python3
2021-12-16
1
391
题解 | #字符串字符匹配#
```while True: try: str1 = list(input()) str2 = list(input()) for i in str1: if i not in str2: ...
Python3
2021-12-16
16
2146
首页
上一页
1
2
3
下一页
末页