Skip to content

Commit

Permalink
Update 11723_1.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
encrypted-def committed Mar 17, 2024
1 parent 4018718 commit 1e91032
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Appendix C/11723_1.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// http://boj.kr/1febea8e97bb4493925075f36d6efb8d
// http://boj.kr/7c4a1a954b7f4aa19635cf6dcfc5a5c6
#include <bits/stdc++.h>
using namespace std;

int chk[20];
int state[20];

int main(){
ios::sync_with_stdio(0);
Expand All @@ -16,25 +16,25 @@ int main(){
cin >> com;
if(com == "add"){
cin >> x;
chk[x-1] = 1;
state[x-1] = 1;
}
else if(com == "remove"){
cin >> x;
chk[x-1] = 0;
state[x-1] = 0;
}
else if(com == "check"){
cin >> x;
cout << chk[x-1] << '\n';
cout << state[x-1] << '\n';
}
else if(com == "toggle"){
cin >> x;
chk[x-1] = 1 ^ chk[x-1];
state[x-1] = 1 ^ state[x-1];
}
else if(com == "all"){
fill(chk, chk+20, 1);
fill(state, state+20, 1);
}
else{ // empty
fill(chk, chk+20, 0);
fill(state, state+20, 0);
}
}
}

0 comments on commit 1e91032

Please sign in to comment.