选择题除了和前端相关的,基本上就是靠瞎编
编程题用python写的,搞不懂题目含义,没有技术,求大佬教教思路,救救孩子把
第一题ac:55
def APlusB(n): temp = [] array = [[(i,j)for j in range(9)] for i in range(9)] if(n < 220): return 0 else: a = str(n//2)[0] for i in range(9): for List in array: for b,c in List: if(b != a and c !=a and (10*(b+c)+2*c == n - 2*int(a)*100)): Str = a + str(b) + str(c) +' ' + a + str(c) + str(c) if(Str not in temp): temp.append(Str) return temp n = int(input()) arr = APlusB(n) print(len(arr)) for i in arr: print(i)第二题ac:27
我没搞懂他到底怎么计算,就按照思路在x前面的和后面的重复值作为答案了
n = int(input()) arr_high = list(input().split(' ')) arr_long = list(input().split(' ')) highIndex = arr_high.index('X') longIndex = arr_long.index('X') tempMax = [] tempMin = [] Max = [] Min = [] for i in range(len(arr_high)): if(i<=highIndex): if (arr_high[i] not in tempMax): tempMax.append(arr_high[i]) else: if (arr_high[i] not in tempMin): tempMin.append(arr_high[i]) for j in range(len(arr_long)): if(j<=longIndex): if (arr_long[j] in tempMax): Max.append(arr_long[j]) else: if (arr_long[j] in tempMin): Min.append(arr_long[j]) print(len(Max),10 - len(Min))每次笔试完就用一种自己真是个大菜鸡,就这也配求职的想法.......
全部评论
(0) 回帖