牛客511199982号
牛客511199982号
全部文章
分类
题解(33)
归档
标签
去牛客网
登录
/
注册
牛客511199982号的博客
全部文章
(共26篇)
题解 | #24点运算#
flag = 0 res = [] def dfs(nums, track, sums,result): global flag,res if 0 not in track and sums == 24: if result[1] not in ['-','*','/']: flag = 1 res...
Python3
2021-12-17
1
359
题解 | #24点游戏算法#
flag = 0 def dfs(nums, track, sums): global flag if 0 not in track and sums == 24: flag = 1 return for i in range(len(nums)): #print(2,i) if t...
Python3
2021-12-17
3
408
题解 | #Sudoku#
def check(point, i, sudoku): x, y = point[0], point[1] # 同行/同列 #print(x, y) for z in range(9): ##print(z!=x,sudoku[x][z] == i) #print(x,y,z) if z != x...
Python3
2021-12-16
0
313
题解 | #记负均正II#
cup = 0 cdown = 0 alls = 0 while True: try: a = int(input()) if a > 0: alls += a cup += 1 elif a < 0: cdown +=1 ...
Python3
2021-12-10
0
276
题解 | #记票统计#
while True: try: n1 = int(input()) s_list1 = list(input().split()) result = dict(zip(s_list1,[0]*n1)) n2 = int(input()) s_list2 = list(input().split()...
Python3
2021-12-10
0
239
题解 | #在字符串中找出连续最长的数字串#
while True: try: s = input() lens = 0 out = '' for i in s: if not i.isdigit(): #print(i) s = s.replace(i, '') s_list = s.split('') for i in s_list: if...
Python3
2021-12-10
0
241
题解 | #整数与IP地址间的转换#
while True: try: s = input() out = '' xxxx = [] if '.' in s: a = list(map(int,s.split('.'))) for i in a: v = bin(i)[2:] c = len(v) if c < 8: out = ...
Python3
2021-12-10
0
239
题解 | #字符统计#
while True: try: s=input() result = {} out = [] for i in s: num = s.count(i) if num not in result.keys(): result[num] = i else: if i not in result[num...
Python3
2021-12-10
0
259
题解 | #字符串分隔#
while True: try: s = input() lens = len(s) result = [] if lens == 0 or lens == 8: #print('1') print(s) elif lens < 8: # print('2') c = 8-lens print...
Python3
2021-12-10
0
231
题解 | #删除字符串中出现次数最少的字符#
def shanchu(a): for i in range(value[a]): list_s.remove(a) while True: try: value = {} s = input() list_s = list(s) #print(list_s) for i in s: if i no...
Python3
2021-12-10
0
213
首页
上一页
1
2
3
下一页
末页