Skip to content

Commit ceb5b33

Browse files
committed
[BOJ] 21918 전구 (B2)
1 parent 33819b6 commit ceb5b33

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

심수연/6주차/260206.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# https://www.acmicpc.net/problem/21918
2+
3+
import sys
4+
input = sys.stdin.readline
5+
6+
N, M = map(int, input().split())
7+
bulb = list(map(int, input().split()))
8+
9+
for i in range(M):
10+
a, b, c = map(int, input().split())
11+
if a == 1:
12+
bulb[b - 1] = c
13+
elif a == 2:
14+
for j in range(b - 1, c):
15+
bulb[j] = int(not bulb[j])
16+
elif a == 3:
17+
for j in range(b - 1, c):
18+
bulb[j] = 0
19+
else:
20+
for j in range(b - 1, c):
21+
bulb[j] = 1
22+
23+
print(*bulb)

0 commit comments

Comments
 (0)