解题思路:
注意事项:
参考代码:
n = int(input())
l = []
row = []
cul = []
for i in range(n):
s = list(map(int,input().split()))
l.append(s)
for k in range(n-1): # 开始n-1个操作
row = []
cul = []
print(l[1][1])
for i in range(n): # 求每行最小值
min = l[i][0]
for j in range(n):
if l[i][j] < min:
min = l[i][j]
row.append(min)
for i in range(n): # 对每行进行减去最小值
for j in range(n):
l[i][j] -= row[i]
for i in range(n): # 求每列最小值
min = l[0][i]
for j in range(n):
if l[j][i] < min:
min = l[j][i]
cul.append(min)
for i in range(n): # 对每列进行减去最小值
for j in range(n):
l[j][i] -= cul[i]
x = l[1][1]
for i in range(n):
l[i].pop(1)
l.pop(1)
n -= 1
print(x)
0.0分
0 人评分
永远的丰碑 (C语言代码)浏览:698 |
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:530 |
WU-C语言程序设计教程(第三版)课后习题11.11 (C++代码)(想学链表的可以看看)浏览:1465 |
简单的a+b (C语言代码)浏览:574 |
简单的a+b (C语言代码)浏览:444 |
C语言程序设计教程(第三版)课后习题7.3 (C语言代码)浏览:569 |
良心推荐——>题解1049:C语言程序设计教程(第三版)课后习题11.1 (C语言描述——简单明了,时间复杂度低)浏览:1318 |
C语言程序设计教程(第三版)课后习题3.7 (C语言代码)浏览:545 |
敲七 (C++代码)浏览:1119 |
小O的乘积 (C语言代码)浏览:1062 |