8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2cdcc3f commit 11db16dCopy full SHA for 11db16d
Appendix C/11723_1.cpp
@@ -0,0 +1,40 @@
1
+// http://boj.kr/1febea8e97bb4493925075f36d6efb8d
2
+#include <bits/stdc++.h>
3
+using namespace std;
4
+
5
+int chk[20];
6
7
+int main(){
8
+ ios::sync_with_stdio(0);
9
+ cin.tie(0);
10
11
+ int m;
12
+ cin >> m;
13
+ while(m--){
14
+ string com;
15
+ int x;
16
+ cin >> com;
17
+ if(com == "add"){
18
+ cin >> x;
19
+ chk[x-1] = 1;
20
+ }
21
+ else if(com == "remove"){
22
23
+ chk[x-1] = 0;
24
+ } 8000 div>
25
+ else if(com == "check"){
26
27
+ cout << chk[x-1] << '\n';
28
29
+ else if(com == "toggle"){
30
31
+ chk[x-1] = 1 ^ chk[x-1];
32
33
+ else if(com == "all"){
34
+ fill(chk, chk+20, 1);
35
36
+ else{ // empty
37
+ fill(chk, chk+20, 0);
38
39
40
+}
0 commit comments