Skip to content

Commit 0fba972

Browse files
committed
[BOJ] #1018.체스판 다시 칠하기 / 실버4 / 30(∆)
1 parent 7610299 commit 0fba972

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

learntosurf/BruteForce/2024-11-07-[BOJ]-#14717-앉았다.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
## 틀린 풀이 ##
2+
13
from itertools import combinations
24
from math import comb
35

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

0 commit comments

Comments
 (0)