Olympic Sinh Viên 2022 - Không chuyên - Nghệ thuật trừu tượng

View as PDF

Submit solution

Points: 0.10 (partial)
Time limit: 1.0s
Memory limit: 512M

Problem types
Allowed languages
C, C++, Go, Java, Kotlin, Pascal, PyPy, Python, Rust, Scratch

In case the statement didn't load correctly, you can download the statement here: Statement


Comments

Please read the guidelines before commenting.



  • 1
    vominhmanh10  commented on Dec. 6, 2025, 5:49 a.m. edit 2

    nó kêu nhìn 4 hướng duyệt 4 hướng lun

    import sys
    input = sys.stdin.readline
    
    n, m = map(int, input().split())
    a = [list(map(int, i.split())) for i in sys.stdin.readlines()]
    vis = [bytearray(m) for _ in range(n)]
    for i in range(n):
        ans = 0
        for j in range(m):
            if a[i][j] > ans:
                ans = a[i][j]
                vis[i][j] = 1
        ans = 0
        for j in range(m - 1, -1, -1):
            if a[i][j] > ans:
                ans = a[i][j]
                vis[i][j] = 1
    for j in range(m):
        ans = 0
        for i in range(n):
            if a[i][j] > ans:
                ans = a[i][j]
                vis[i][j] = 1
        ans = 0
        for i in range(n - 1, -1, -1):
            if a[i][j] > ans:
                ans = a[i][j]
                vis[i][j] = 1
    
    print(sum(i.count(1) for i in vis))
    

  • -1
    danglebinhnguyen2014  commented on Nov. 26, 2024, 5:43 a.m.

    bài này dễ thiệt

    Dễ sai

    Khó đúng


  • 1
    Groot  commented on June 8, 2024, 1:14 a.m.

    lưu ý:

    Trường hợp đặc biệt: cột ngoài cùng có độ cao = 0 :))


    • -1
      zackdeaths  commented on Sept. 26, 2024, 6:47 a.m.

      cay thật :/


  • -2
    anhnguyen  commented on Oct. 25, 2023, 4:47 a.m.

    =(( +1 nộp bên bài cắt dán, cayy