Skip to content

Commit 4234c5d

Browse files
authored
[BOJ] 블랙잭 / 실버4 / 30분(X) -m "https://www.acmicpc.net/problem/1018"
1 parent 54fadc5 commit 4234c5d

File tree

1 file changed

+27
-0
lines changed
  • learntosurf/Baekjoon/12_브루트 포스

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# 다른 풀이
2+
m, n = map(int, input().split())
3+
plate = []
4+
count = []
5+
6+
for _ in range(m):
7+
plate.append(input())
8+
9+
for a in range(m-7):
10+
for b in range(n-7):
11+
W = 0
12+
B = 0
13+
for i in range(a, a+8):
14+
for j in range(b, b+8):
15+
if (i+j) % 2 == 0:
16+
if plate[i][j] != 'W':
17+
W += 1
18+
if plate[i][j] != 'B':
19+
B += 1
20+
else:
21+
if plate[i][j] != 'B':
22+
W += 1
23+
if plate[i][j] != 'W':
24+
B += 1
25+
count.append(min(W, B))
26+
27+
print(min(count))

0 commit comments

Comments
 (0)