We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 33819b6 commit ceb5b33Copy full SHA for ceb5b33
1 file changed
심수연/6주차/260206.py
@@ -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
18
+ bulb[j] = 0
19
+ else:
20
21
+ bulb[j] = 1
22
23
+print(*bulb)
0 commit comments