[배열] 백준 2799번 블라인드

정은경·2020년 5월 19일
0

백준 문제풀이

목록 보기
12/51

1. 문제


2. 나의 풀이

# M 층 / N 층별 창문수
M, N = [int(x) for x in input().split()]

type_counts = [0 for i in range(5)]
# print(types)
windows = list()
# temp = input().split("#")
# print(temp)
rlt = list()


for m in range(M):
    start = input()
    types = [0 for _ in range(N)]
    for i in range(4):
        windows = input().split("#")[1:-1]
        for idx, w in enumerate(windows):
            if w == "****":
                types[idx] += 1
    #print(types)
    rlt.append(types)
end = input()
# print(rlt)

for r in rlt:
    type_counts[0] += r.count(0)
    type_counts[1] += r.count(1)
    type_counts[2] += r.count(2)
    type_counts[3] += r.count(3)
    type_counts[4] += r.count(4)

# print(type_counts)
yeah = ' '.join([str(x) for x in type_counts])
print(yeah)
  • 좀더 효과적인 방법은 없을까..?!

3. 남의 풀이

4. 느낀 점

profile
#의식의흐름 #순간순간 #생각의스냅샷

0개의 댓글