网易互娱的第二题是我这么写的,动态的删除数组 while True: try: n = int(input()) ss = [] for _ in range(n): ss.append(list(map(int,input().split()))) for i in range(n): max_count = 0 loc_i = 0 loc_j = 0 for j in range(n-i): for w in range(n-i): if sum(ss[j][:])+sum(ss[:][w])-ss[j][w] > max_count: max_count=sum(ss[j][:])+sum(ss[:][w])-ss[j][w] loc_i = j loc_j = w for q in range(n-i): del ss[q][loc_j] ss.remove(ss[loc_i]) print(str(loc_i+1)+' '+str(loc_j+1)) except: break
点赞 9

相关推荐

做黑夜里的那道光:两年电赛完赛没必要写,纯扣分
双非本科求职如何逆袭
点赞 评论 收藏
分享
昨天 22:46
门头沟学院 Java
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务