We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 54fadc5 commit 4234c5dCopy full SHA for 4234c5d
learntosurf/Baekjoon/12_브루트 포스/1018.py
@@ -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
22
23
24
25
+ count.append(min(W, B))
26
27
+print(min(count))
0 commit comments