[λ°±μ€-2563] μμ’
μ΄ / Python
π Problem Solving/Baekjoon
import sys
input = sys.stdin.readline
paper = [[0] * 101 for _ in range(101)]
for _ in range(int(input())):
x, y = map(int, input().split())
for i in range(x, x + 10):
for j in range(y, y + 10):
paper[i][j] = 1
answer = 0
for row in paper:
answer += row.count(1)
print(answer)
ν΄μ€
κ°λ‘, μΈλ‘μ ν¬κΈ°κ° 100μΈ ν° λνμ§ μμ μ¬κ°νμ μ¬λ¦¬λ κ²μ΄λ―λ‘ 101x101μ paper 리μ€νΈλ₯Ό λ§λ€μ΄μ€λ€. λͺ¨λ κ°μ 0μΌλ‘ μ΄κΈ°ννλ€.
μ£Όμ΄μ§ xμ y μ λ ₯ κ°μ +10μ© μ¦κ°μμΌμ£Όλ λ²μλ₯Ό paperμμ λͺ¨λ 1λ‘ λ°κΏμ€λ€.((x, x+10), (y, y+10) λ²μμ μ¬κ°ν)
κ·Έλ¦¬κ³ 1μ κ°μλ₯Ό μΆλ ₯νλ€.
'π Problem Solving > Baekjoon' μΉ΄ν κ³ λ¦¬μ λ€λ₯Έ κΈ
[λ°±μ€-1292] μ½κ² νΈλ λ¬Έμ / Python (0) | 2021.06.19 |
---|---|
[λ°±μ€-2504] κ΄νΈμ κ° / Python (0) | 2021.06.19 |
[λ°±μ€-14503] λ‘λ΄ μ²μκΈ° / Python (0) | 2021.06.19 |
[λ°±μ€-2960] μλΌν μ€ν λ€μ€μ 체 / Python (0) | 2021.06.18 |
[λ°±μ€-11052] μΉ΄λ ꡬ맀νκΈ° / Python (0) | 2021.06.18 |