-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path11723.cpp
More file actions
32 lines (31 loc) · 739 Bytes
/
Copy path11723.cpp
File metadata and controls
32 lines (31 loc) · 739 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include <iostream>
#define SETTING ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define endl "\n"
using namespace std ;
unsigned int arr ;
int main()
{
SETTING ;
int N, x ;
cin >> N ;
string str ;
while(N--)
{
cin >> str ;
if(str == "all" || str == "empty")
{
str == "all" ? arr = (1<<21) - 1 : arr = 0 ;
}
else
{
cin >> x ;
switch(str[0])
{
case 'a' : arr = arr | (1<<x) ; break ;
case 'r' : arr &= (arr ^ (1<<x)) ; break ;
case 't' : arr ^= (1<<x) ; break ;
case 'c' : arr & (1<<x) ? cout << "1\n" : cout << "0\n" ;
}
}
}
}