Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

H, W, M = map(int, input().split())
row = np.zeros(W)
col = np.zeros(H)
memo = []
for _ in range(M):
    h, w = map(int, input().split())
    h -=1
    w -=1
    row[w] += 1
    col[h] += 1
    memo.append((h, w))

col_max = col.max()
row_max = row.max()

max_col_indexs = np.where(col == col_max)[0]
max_row_indexs = np.where(row == row_max)[0]

ans = col_max + row_max -1
for c in max_col_indexs:
    for r in max_row_indexs:
        if (c, r) not in memo:
            ans = ans = col_max + row_max
            break

print(int(ans))

Fixed submission:
import numpy as np
def main():
    H, W, M = map(int, input().split())
    row = np.zeros(W)
    col = np.zeros(H)
    memo = []
    for _ in range(M):
        h, w = map(int, input().split())
        h -=1
        w -=1
        row[w] += 1
        col[h] += 1
        memo.append((h, w))

    col_max = col.max()
    row_max = row.max()

    max_col_indexs = np.where(col == col_max)[0]
    max_row_indexs = np.where(row == row_max)[0]

    ans = col_max + row_max -1
    memo = set(memo)
    for c in max_col_indexs:
        for r in max_row_indexs:
            if (c, r) not in memo:
                ans = ans = col_max + row_max
                print(int(ans))
                exit()

    print(int(ans))

if __name__ == "__main__":
    main()

Buggy python submission (verdict: Runtime Error):
import numpy as np
from numba import njit, b1, i4, i8, f8

@njit((i8, i8, i8[:]), cache=True)
def main():
    H, W, M = map(int, input().split())
    row = np.zeros(W)
    col = np.zeros(H)
    memo = []
    for _ in range(M):
        h, w = map(int, input().split())
        h -=1
        w -=1
        row[w] += 1
        col[h] += 1
        memo.append((h, w))

    col_max = col.max()
    row_max = row.max()

    max_col_indexs = np.where(col == col_max)[0]
    max_row_indexs = np.where(row == row_max)[0]

    ans = col_max + row_max -1
    for c in max_col_indexs:
        for r in max_row_indexs:
            if (c, r) not in memo:
                ans = ans = col_max + row_max
                break

    print(int(ans))

if __name__ == "__main__":
    main()

Fixed submission:
import numpy as np
def main():
    H, W, M = map(int, input().split())
    row = np.zeros(W)
    col = np.zeros(H)
    memo = []
    for _ in range(M):
        h, w = map(int, input().split())
        h -=1
        w -=1
        row[w] += 1
        col[h] += 1
        memo.append((h, w))

    col_max = col.max()
    row_max = row.max()

    max_col_indexs = np.where(col == col_max)[0]
    max_row_indexs = np.where(row == row_max)[0]

    ans = col_max + row_max -1
    memo = set(memo)
    for c in max_col_indexs:
        for r in max_row_indexs:
            if (c, r) not in memo:
                ans = ans = col_max + row_max
                print(int(ans))
                exit()

    print(int(ans))

if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
from numba import jit

@jit
def main():
    H, W, M = map(int, input().split())
    row = np.zeros(W)
    col = np.zeros(H)
    memo = []
    for _ in range(M):
        h, w = map(int, input().split())
        h -=1
        w -=1
        row[w] += 1
        col[h] += 1
        memo.append((h, w))

    col_max = col.max()
    row_max = row.max()

    max_col_indexs = np.where(col == col_max)[0]
    max_row_indexs = np.where(row == row_max)[0]

    ans = col_max + row_max -1
    for c in max_col_indexs:
        for r in max_row_indexs:
            if (c, r) not in memo:
                ans = ans = col_max + row_max
                break

    print(int(ans))

if __name__ == "__main__":
    main()

Fixed submission:
import numpy as np
def main():
    H, W, M = map(int, input().split())
    row = np.zeros(W)
    col = np.zeros(H)
    memo = []
    for _ in range(M):
        h, w = map(int, input().split())
        h -=1
        w -=1
        row[w] += 1
        col[h] += 1
        memo.append((h, w))

    col_max = col.max()
    row_max = row.max()

    max_col_indexs = np.where(col == col_max)[0]
    max_row_indexs = np.where(row == row_max)[0]

    ans = col_max + row_max -1
    memo = set(memo)
    for c in max_col_indexs:
        for r in max_row_indexs:
            if (c, r) not in memo:
                ans = ans = col_max + row_max
                print(int(ans))
                exit()

    print(int(ans))

if __name__ == "__main__":
    main()

Buggy python submission (verdict: Runtime Error):
import numpy as np

H, W, M = map(int, input().split())
row = np.zeros(W)
col = np.zeros(H)
memo = []
for _ in range(M):
    h, w = map(int, input().split())
    h -=1
    w -=1
    row[w] += 1
    col[h] += 1
    memo.append((h, w))

col_max = col.max()
row_max = row.max()

max_col_indexs = np.where(col == col_max)[0]
max_row_indexs = np.where(row == row_max)[0]

ans = col_max + row_max -1
for c in max_col_indexs:
    for r in max_row_indexs:
        if (c, r) not in memo:
            ans = ans = col_max + row_max
            break

print(int(ans))

Fixed submission:
import numpy as np
def main():
    H, W, M = map(int, input().split())
    row = np.zeros(W)
    col = np.zeros(H)
    memo = []
    for _ in range(M):
        h, w = map(int, input().split())
        h -=1
        w -=1
        row[w] += 1
        col[h] += 1
        memo.append((h, w))

    col_max = col.max()
    row_max = row.max()

    max_col_indexs = np.where(col == col_max)[0]
    max_row_indexs = np.where(row == row_max)[0]

    ans = col_max + row_max -1
    memo = set(memo)
    for c in max_col_indexs:
        for r in max_row_indexs:
            if (c, r) not in memo:
                ans = ans = col_max + row_max
                print(int(ans))
                exit()

    print(int(ans))

if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

H, W, M = map(int, input().split())
row = np.zeros(W)
col = np.zeros(H)
memo = []
for _ in range(M):
    h, w = map(int, input().split())
    h -=1
    w -=1
    row[w] += 1
    col[h] += 1
    memo.append((h, w))

col_max = col.max()
row_max = row.max()

max_col_indexs = np.where(col == col_max)[0]
max_row_indexs = np.where(row == row_max)[0]

ans = col_max + row_max -1
for c in max_col_indexs:
    for r in max_row_indexs:
        if (c, r) not in memo:
            ans = ans = col_max + row_max
            break

print(int(ans))

Fixed submission:
import numpy as np
def main():
    H, W, M = map(int, input().split())
    row = np.zeros(W)
    col = np.zeros(H)
    memo = []
    for _ in range(M):
        h, w = map(int, input().split())
        h -=1
        w -=1
        row[w] += 1
        col[h] += 1
        memo.append((h, w))

    col_max = col.max()
    row_max = row.max()

    max_col_indexs = np.where(col == col_max)[0]
    max_row_indexs = np.where(row == row_max)[0]

    ans = col_max + row_max -1
    memo = set(memo)
    for c in max_col_indexs:
        for r in max_row_indexs:
            if (c, r) not in memo:
                ans = ans = col_max + row_max
                print(int(ans))
                exit()

    print(int(ans))

if __name__ == "__main__":
    main()

Buggy python submission (verdict: Runtime Error):
import numpy as np

H, W, M = map(int, input().split())
bomb = np.zeros((H, W))
for _ in range(M):
    h, w = map(int, input().split())
    h -=1
    w -=1
    bomb[h, w] = 1

col_sum = np.sum(bomb, axis=0)
row_sum = np.sum(bomb, axis=1)

col_max = col_sum.max()
row_max = row_sum.max()

max_col_indexs = np.where(col_sum == col_max)[0]
max_row_index = np.argmax(row_sum)

ans = col_sum.max() + row_sum.max() - 1
for col in max_col_indexs:
    if bomb[max_row_index, col] == 0:
        ans = ans = col_sum.max() + row_sum.max()
        break

print(int(ans))

Fixed submission:
import numpy as np
def main():
    H, W, M = map(int, input().split())
    row = np.zeros(W)
    col = np.zeros(H)
    memo = []
    for _ in range(M):
        h, w = map(int, input().split())
        h -=1
        w -=1
        row[w] += 1
        col[h] += 1
        memo.append((h, w))

    col_max = col.max()
    row_max = row.max()

    max_col_indexs = np.where(col == col_max)[0]
    max_row_indexs = np.where(row == row_max)[0]

    ans = col_max + row_max -1
    memo = set(memo)
    for c in max_col_indexs:
        for r in max_row_indexs:
            if (c, r) not in memo:
                ans = ans = col_max + row_max
                print(int(ans))
                exit()

    print(int(ans))

if __name__ == "__main__":
    main()

Buggy python submission (verdict: Runtime Error):
import numpy as np

H, W, M = map(int, input().split())
bomb = np.zeros((H, W))
for _ in range(M):
    h, w = map(int, input().split())
    h -=1
    w -=1
    bomb[h, w] = 1

col_sum = np.sum(bomb, axis=0)
row_sum = np.sum(bomb, axis=1)

col_max = col_sum.max()
row_max = row_sum.max()

max_col_indexs = np.where(col_sum == col_max)[0]
max_row_index = np.argmax(row_sum)

ans = col_sum.max() + row_sum.max() - 1
for col in max_col_indexs:
    if bomb[max_row_index, col] == 0:
        ans = ans = col_sum.max() + row_sum.max()
        break

print(int(ans))

Fixed submission:
import numpy as np
def main():
    H, W, M = map(int, input().split())
    row = np.zeros(W)
    col = np.zeros(H)
    memo = []
    for _ in range(M):
        h, w = map(int, input().split())
        h -=1
        w -=1
        row[w] += 1
        col[h] += 1
        memo.append((h, w))

    col_max = col.max()
    row_max = row.max()

    max_col_indexs = np.where(col == col_max)[0]
    max_row_indexs = np.where(row == row_max)[0]

    ans = col_max + row_max -1
    memo = set(memo)
    for c in max_col_indexs:
        for r in max_row_indexs:
            if (c, r) not in memo:
                ans = ans = col_max + row_max
                print(int(ans))
                exit()

    print(int(ans))

if __name__ == "__main__":
    main()

Buggy python submission (verdict: Runtime Error):
import numpy as np

H, W, M = map(int, input().split())
bomb = np.zeros((H, W))
for _ in range(M):
    h, w = map(int, input().split())
    h -=1
    w -=1
    bomb[h, w] = 1

col_sum = np.sum(bomb, axis=0)
row_sum = np.sum(bomb, axis=1)

col_max = col_sum.max()
row_max = row_sum.max()

max_col_indexs = np.where(col_sum == col_max)[0]
max_row_index = np.argmax(row_sum)

ans = col_sum.max() + row_sum.max() - 1
for col in max_col_indexs:
    if bomb[max_row_index, col] == 0:
        ans = ans = col_sum.max() + row_sum.max()
        break

print(int(ans))



Fixed submission:
import numpy as np
def main():
    H, W, M = map(int, input().split())
    row = np.zeros(W)
    col = np.zeros(H)
    memo = []
    for _ in range(M):
        h, w = map(int, input().split())
        h -=1
        w -=1
        row[w] += 1
        col[h] += 1
        memo.append((h, w))

    col_max = col.max()
    row_max = row.max()

    max_col_indexs = np.where(col == col_max)[0]
    max_row_indexs = np.where(row == row_max)[0]

    ans = col_max + row_max -1
    memo = set(memo)
    for c in max_col_indexs:
        for r in max_row_indexs:
            if (c, r) not in memo:
                ans = ans = col_max + row_max
                print(int(ans))
                exit()

    print(int(ans))

if __name__ == "__main__":
    main()