Notice
Recent Posts
Recent Comments
Link
나의 개발일지
[백준] 1388 바닥 장식 [Python, 파이썬] 본문
- 문제 : https://www.acmicpc.net/problem/1388
- 전체 타일의 개수 n*m에서 연결된 타일의 수를 빼주었다.
n, m = map(int, input().split())
lst = [list(input()) for _ in range(n)]
answer = n * m
for i in range(n):
for j in range(m):
if j != m-1 and lst[i][j] == "-" and lst[i][j+1] == "-":
answer -= 1
if i != n-1 and lst[i][j] == "|" and lst[i+1][j] == "|":
answer -= 1
print(answer)
'백준' 카테고리의 다른 글
[백준] 11724 연결 요소의 개수 [Python, 파이썬] (0) | 2023.09.15 |
---|---|
[백준] 26169 세 번 이내에 사과를 먹자 [Python, 파이썬] (0) | 2023.09.15 |
[백준] 16173 점프왕 쩰리(Small) [Python, 파이썬] (0) | 2023.09.14 |
[공식] 조합 공식, 순열 공식 (0) | 2023.09.11 |
[백준] 17202 핸드폰 번호 궁합 [Python, 파이썬] (0) | 2023.09.11 |
Comments