Notice
Recent Posts
Recent Comments
Link
목록1388 (1)
나의 개발일지
문제 : 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)
백준
2023. 9. 14. 20:11