first commit

from old repository to a new repository
This commit is contained in:
Gyubin Han
2024-04-30 16:59:10 +09:00
commit 2600340c03
93 changed files with 1610 additions and 0 deletions

28
boj/11723.py Normal file
View File

@@ -0,0 +1,28 @@
import sys
n=int(sys.stdin.readline().rstrip())
arr=set()
for _ in range(n):
com=sys.stdin.readline().rstrip().split()
if len(com)==1:
if com[0]=="all":
arr=set([i for i in range(1,21)])
else:
arr.clear()
else:
num=int(com[1])
if com[0]=="add":
arr.add(num)
elif com[0]=="remove":
arr.discard(num)
elif com[0]=="check":
if num in arr:
print(1)
else:
print(0)
elif com[0]=="toggle":
if num in arr:
arr.discard(num)
else:
arr.add(num)