python-algorithm1422 [백준] 12836 1 2 3 4 5 6 n,q=map(int, input().split()) ans=[0]*(n+1) for _ in range(q): a,b,c=map(int,input().split()) if a==1: ans[b]+= c elif a==2: print(sum(ans[b:c+1])) cs 2021. 1. 14. [백준] 12813 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 a=input() b=input() for i in range(len(a)): if a[i]== '1' and b[i]=='1' : print('1',end='') else: print('0',end='') print() for i in range(len(a)): if a[i]== '1' or b[i]=='1' : print('1',end='') else: print('0',end='') print() for i in range(len(a)): if int(a[i])+int(b[i])==1 : print('1',end='') else: print('0',end='') print() for i in range(.. 2021. 1. 13. [백준] 12780 1 print(input().count(input())) cs 한줄 컽. 2021. 1. 13. [백준] 12605 1 2 3 4 for _ in range(int(input())): s=list(input().split()) print("Case #%d: "%(_+1),end='') print(*s[::-1]) cs 2021. 1. 13. [백준] 11945 1 2 3 a,b=input().split() for _ in range(int(a)): print(input()[::-1]) cs 2021. 1. 13. [백준] 11721 1 2 3 s=input() for i in range(len(s)//10+1): print(s[10*(i):10*(i+1)]) cs python은 문자열 파싱이 참 편리한 것 같습니다 :D 2021. 1. 13. [백준] 11720 1 2 3 n=int(input()) s=map(int,input()) print(sum(s)) cs 2021. 1. 13. [백준] 11648 1 2 3 4 5 6 7 8 9 10 11 12 13 def multi_digit(n): ans=1 for i in str (n): ans*=int(i) return ans n=input() cnt=0 while int (n)>=10: if int(n) 2021. 1. 13. [백준] 11531 1 2 3 4 5 6 7 8 9 10 acm=[] cnt=0 anscnt=0 while 1: try: a,b,c=input().split() if c=='right': cnt+=acm.count(b)*20+int (a) ; anscnt+=1 acm.append(b) except : break print(anscnt, cnt) Colored by Color Scripter cs 2021. 1. 13. [백준] 11365 1 2 3 4 5 while 1: s=input() if s=="END" : exit() else: print(s[::-1]) cs 2021. 1. 13. [백준] 11296 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 for _ in range(int(input())): a,b,c,d=input().split() a=float(a) if b=='R': a*=0.55 elif b == 'G': a*=0.7 elif b == 'B': a*=0.8 elif b == 'Y': a*=0.85 elif b== 'O' : a*=0.9 elif b == 'W': a*=0.95 if c=='C' : a*=0.95 if d=='P': print("$%.2f" %a) else : a*=100 int(a) if a%10 >5: a=a+10-a%10 else: a-=a%10 print("$%.2f"% (a/100)) cs 2021. 1. 13. [백준] 11094 1 2 3 for _ in range(int(input())): tmp=list(input().split()) if tmp[0]=='Simon' and tmp[1]=='says' : print("",*tmp[2:]) cs 2021. 1. 13. 이전 1 ··· 90 91 92 93 94 95 96 ··· 119 다음