본문 바로가기

백준1056

백준 23303 이 문제는 D2 입니다. 1 2 3 s=input() if 'd2' in s or 'D2' in s:print('D2') else: print('unrated') cs 2021. 11. 30.
백준 23080 스키테일 암호 1 2 3 4 5 6 n=int(input()) s=input() ans='' for i in range(0,len(s),n): ans+=s[i] print(ans) cs 2021. 11. 30.
백준 23027 1번부터 문제의 상태가…? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 s=input() n=len(s) tmpA='BCDF' tmpB='CDF' tmpC='DF' if 'A' in s: for i in s: if i in tmpA: s=s.replace(i,'A') elif 'B' in s: for i in s: if i in tmpB: s=s.replace(i,'B') elif 'C' in s: for i in s: if i in tmpC: s=s.replace(i,'C') else: s='A'*n print(s) cs 2021. 11. 30.
백준 22966 가장 쉬운 문제를 찾는 문제 1 2 3 4 5 6 n=int(input()) tmp=[] for i in range(n): tmp.append(input().split()) tmp=sorted(tmp,key= lambda x:x[1]) print(tmp[0][0]) cs 2021. 11. 30.
백준 21964 선린인터넷고등학교 교가 1 2 3 n=int(input()) s=input() print(s[-5:-1]+s[n-1]) cs 2021. 11. 30.
백준 21918 전구 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 n,m=map(int,input().split()) bulbs=list(map(int, input().split())) for i in range(m): a,b,c=map(int, input().split()) if a==1: bulbs[b-1]=c elif a==2 : for j in range(b-1,c): if bulbs[j]==1:bulbs[j]=0 else : bulbs[j]=1 elif a==3: for j in range(b-1, c): bulbs[j]=0 elif a==4: for j in range(b-1, c): bulbs[j]=1 print(*bulbs) cs 2021. 11. 30.
백준 21756 지우개 1 2 3 4 5 6 7 8 n=int(input()) mylist=[i+1 for i in range(n)] while len(mylist)>1: for i in range(0,len(mylist),2): mylist[i]=0 while 0 in mylist: mylist.remove(0) print(*mylist) cs 바로 pop이나 remove를 통해서 지워버리면 인덱스 순서가 꼬여서 0으로 바꾸고 0인 인덱스를 찾아서 remove 해서 구현함 2021. 11. 30.
백준 21734 SMUPC의 등장 1 2 3 4 5 6 7 8 9 10 def alphaToAscii(s): num= ord(s) ans=0 while num>0: ans+=num%10 num=num//10 return ans mystr=input() for i in mystr: print(i*(alphaToAscii(i))) cs 2021. 11. 30.
백준 21567 숫자의 개수 2 1 2 3 4 5 6 7 8 9 10 a=int(input()) b=int(input()) c=int(input()) num=a*b*c cnt=[0]*10 while num>0: cnt[num%10]+=1 num=num//10 for i in cnt: print(i) cs 2021. 11. 30.
백준 16483 접시 안의 원 1 2 t=int(input()) print(int (round( pow(t,2)/4 ,0)) ) cs 2021. 11. 30.
백준 21866 추첨을 통해 커피를 받자 1 2 3 4 5 6 7 8 9 10 11 12 score=list(map(int,input().split())) if score[0]>100: print('hacker'); exit() if score[1]>100: print('hacker'); exit() if score[2]>200: print('hacker'); exit() if score[3]>200: print('hacker'); exit() if score[4]>300: print('hacker'); exit() if score[5]>300: print('hacker'); exit() if score[6]>400: print('hacker'); exit() if score[7]>400: print('hacker'); exit() if sco.. 2021. 11. 30.
백준 22864 피로도 1 2 3 4 5 6 7 8 9 10 11 12 a,b,c,m=map(int, input().split()) fatigue=0 work=0 for i in range(24): if fatigue m: fatigue-=c continue else: fatigue+=a work+=b print(work) cs 2021. 11. 30.