Submission #21935444


Source Code Expand

def main():
    h, w = map(int, input().split())
    a = [list(map(int, input().split())) for _ in range(h)]
    rows = [sum(x) for x in a]
    cols = [sum(x[j] for x in a) for j in range(w)]
    print(*(' '.join(str(rows[i] + cols[j] - a[i][j])
                     for j in range(w)) for i in range(h)), sep='\n')


if __name__ == "__main__":
    main()

Submission Info

Submission Time
Task 004 - Cross Sum(★2)
User riantkb
Language Python (3.8.2)
Score 2
Code Size 356 Byte
Status AC
Exec Time 1975 ms
Memory 93752 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 2 / 2
Status
AC × 4
AC × 16
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt, sample_04.txt
All hand01.txt, hand02.txt, hand03.txt, hand04.txt, random01.txt, random02.txt, random03.txt, random04.txt, random05.txt, random06.txt, random07.txt, random08.txt, sample_01.txt, sample_02.txt, sample_03.txt, sample_04.txt
Case Name Status Exec Time Memory
hand01.txt AC 20 ms 9180 KiB
hand02.txt AC 29 ms 9432 KiB
hand03.txt AC 27 ms 9376 KiB
hand04.txt AC 1975 ms 93752 KiB
random01.txt AC 181 ms 13824 KiB
random02.txt AC 678 ms 34276 KiB
random03.txt AC 420 ms 22032 KiB
random04.txt AC 552 ms 28184 KiB
random05.txt AC 31 ms 9300 KiB
random06.txt AC 144 ms 12516 KiB
random07.txt AC 1712 ms 80128 KiB
random08.txt AC 377 ms 20512 KiB
sample_01.txt AC 18 ms 8892 KiB
sample_02.txt AC 20 ms 9184 KiB
sample_03.txt AC 18 ms 9116 KiB
sample_04.txt AC 24 ms 9048 KiB