Submission #21935466


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 Cython (0.29.16)
Score 2
Code Size 356 Byte
Status AC
Exec Time 1701 ms
Memory 94100 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 46 ms 9492 KiB
hand02.txt AC 32 ms 10144 KiB
hand03.txt AC 27 ms 9896 KiB
hand04.txt AC 1701 ms 94100 KiB
random01.txt AC 172 ms 14640 KiB
random02.txt AC 590 ms 34784 KiB
random03.txt AC 393 ms 22556 KiB
random04.txt AC 482 ms 28620 KiB
random05.txt AC 32 ms 9964 KiB
random06.txt AC 135 ms 13244 KiB
random07.txt AC 1564 ms 80592 KiB
random08.txt AC 329 ms 21092 KiB
sample_01.txt AC 28 ms 9668 KiB
sample_02.txt AC 28 ms 9460 KiB
sample_03.txt AC 23 ms 9732 KiB
sample_04.txt AC 25 ms 9452 KiB