๋ฐฑ์ค 1895 ํํฐ ํ์ด์ฌ
2022. 12. 21. 01:23ใ๐ฑ Algorithm/Else
R, C = map(int, input().split())
board = [list(map(int, input().split())) for r in range(R)]
T = int(input())
def get_median(arr: list):
arr.sort()
return arr[4]
moveC = C - 2
moveR = R - 2
result = []
for mr in range(moveR):
for mc in range(moveC):
result.append(get_median(board[mr][mc: mc + 3] + board[mr + 1][mc: mc + 3] + board[mr + 2][mc: mc + 3]))
print(len(list(filter(lambda x: x >= T, result))))
'๐ฑ Algorithm > Else' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
๋ฐฑ์ค 2470 ๋ ์ฉ์ก ํ์ด์ฌ (0) | 2023.01.29 |
---|---|
๋ฐฑ์ค 1527 ๊ธ๋ฏผ์์ ๊ฐ์ ํ์ด์ฌ (0) | 2022.12.30 |
๋ฐฑ์ค ์์ด 2559๋ฒ ํ์ด์ฌ (0) | 2022.07.12 |
๋ฐฑ์ค 2346 ํ์ ํฐ๋จ๋ฆฌ๊ธฐ ํ์ด์ฌ (0) | 2022.07.04 |
๋ฐฑ์ค 16953 ํ์ด์ฌ (0) | 2022.01.25 |