题解 | #最高身高#
最高身高
http://www.nowcoder.com/practice/258fe0c567ac493f9b7bc9d3669d158d
整合为一维数组分析,较快,但是占内存
a, b = map(int, input().split()) c = [] for i in range(a): d = list(map(int, input().split())) c += d c_max = c.index(max(c)) + 1 e = c_max // b if e == a: f = b else: if b >1 : e += 1 f = c_max - b * (e - 1) print(e, f)
整合为二维数组分析,较慢,但是省内存
a, b = map(int, input().split()) c = [] for i in range(a): d = list(map(int, input().split())) c.append(d) mid = [max(item) for item in c] x = mid.index(max(mid)) y = c[x].index(max(c[x])) print(x + 1, y + 1)

查看11道真题和解析