1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
n,m=map(int,input().split())
bulbs=list(map(int, input().split()))
for i in range(m):
a,b,c=map(int, input().split())
if a==1: bulbs[b-1]=c
elif a==2 :
for j in range(b-1,c):
if bulbs[j]==1:bulbs[j]=0
else : bulbs[j]=1
elif a==3:
for j in range(b-1, c):
bulbs[j]=0
elif a==4:
for j in range(b-1, c):
bulbs[j]=1
print(*bulbs)
|
cs |
반응형
'python-algorithm' 카테고리의 다른 글
백준 22966 가장 쉬운 문제를 찾는 문제 (0) | 2021.11.30 |
---|---|
백준 21964 선린인터넷고등학교 교가 (0) | 2021.11.30 |
백준 21756 지우개 (0) | 2021.11.30 |
백준 21734 SMUPC의 등장 (0) | 2021.11.30 |
백준 21567 숫자의 개수 2 (0) | 2021.11.30 |
댓글