-Code
for t in range(int(input())):
n, m, p = map(int, input().split())
steps = [list(map(int, input().split())) for _ in range(n)]
res = 0
for day in range(m):
max_step = 0
for id in range(n):
if p - 1 != id:
max_step = max(steps[id][day], max_step)
res += max(0, max_step - steps[p - 1][day])
print(f"Case #{t + 1}: {res}")
'Beakjoon&프로그래머스 > 파이썬' 카테고리의 다른 글
[백준/파이썬] 30676번 이 별은 무슨 색일까 (0) | 2023.11.19 |
---|---|
[백준/파이썬] 7280번 Kortos (0) | 2023.11.18 |
[백준/파이썬] 12352번 Hedgemony (Large) (0) | 2023.11.16 |
[백준/파이썬] 7181번 Mõttemeister (0) | 2023.11.15 |
[백준/파이썬] 29319번 Начало (1) | 2023.11.14 |