Submission #21935454


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 PyPy3 (7.3.0)
Score 2
Code Size 356 Byte
Status AC
Exec Time 833 ms
Memory 146604 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 73 ms 61852 KiB
hand02.txt AC 111 ms 70480 KiB
hand03.txt AC 66 ms 68372 KiB
hand04.txt AC 833 ms 146604 KiB
random01.txt AC 158 ms 73888 KiB
random02.txt AC 335 ms 93012 KiB
random03.txt AC 232 ms 85524 KiB
random04.txt AC 310 ms 90124 KiB
random05.txt AC 70 ms 68288 KiB
random06.txt AC 131 ms 72656 KiB
random07.txt AC 747 ms 138788 KiB
random08.txt AC 235 ms 81172 KiB
sample_01.txt AC 52 ms 62004 KiB
sample_02.txt AC 52 ms 62000 KiB
sample_03.txt AC 56 ms 61812 KiB
sample_04.txt AC 50 ms 62048 KiB