Skip to content

Commit

Permalink
22.07.25
Browse files Browse the repository at this point in the history
  • Loading branch information
delena0702 authored Jul 25, 2022
1 parent 8cc2b57 commit 431b463
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions BAEKJOON/14711_타일_뒤집기_(Easy).py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import sys
def input(): return sys.stdin.readline().strip()

N, data = int(input()), list(map(lambda x: x == '#', input()))
next_data = [False] * N
print(*map(lambda x: '#' if x else'.', data), sep='')

for _ in range(N - 1):
for i in range(N):
if i > 0 and data[i - 1]:
next_data[i] = not next_data[i]
if i < N - 1 and data[i + 1]:
next_data[i] = not next_data[i]

data, next_data = next_data, data

print(*map(lambda x: '#' if x else'.', data), sep='')

0 comments on commit 431b463

Please sign in to comment.