网易互娱08.12笔试 - 十字斩python0AC
RT,感觉自己思路没错测试用例也过了为啥提交就是0呢?有没有大佬帮看一下😫
N = int(input()) board = [] for _ in range(N): row = list(map(int, input().split())) board.append(row) chance = N while chance > 0: max_sum = float('-inf') for i in range(chance): sum_row = sum(board[i]) for j in range(chance): sum_column = sum(board[:][j]) score = sum_row + sum_column - board[i][j] if score > max_sum: max_sum = score row_num = i column_num = j print(row_num+1, column_num+1) # delete column for k in range(chance): board[k].pop(column_num) board.pop(row_num) chance -= 1