전체 글1537 [백준] 2523 1 2 3 4 5 6 7 8 9 import sys n=int(sys.stdin.readline()) for i in range(n): for j in range(i+1):print("*",end='') print() for i in range(n-1): for j in range(n-i-1):print("*",end='') if i!=n-1: print() cs 2020. 12. 18. [백준] 2522 1 2 3 4 5 6 7 8 9 10 11 12 import sys n=int(sys.stdin.readline()) for i in range(n): for j in range(n-i-1):print(" ",end='') for j in range(i+1):print("*",end='') print() for i in range(n-1): for j in range(i + 1): print(" ", end='') for j in range(n-i-1):print("*",end='') if i!=n-1: print() cs 2020. 12. 18. [백준] 2511 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 import sys a=list(map(int, sys.stdin.readline().split())) b=list(map(int, sys.stdin.readline().split())) ansa=0 ansb=0 acnt=0 bcnt=0 for i in range(10): if a[i]>b[i]:ansa+=3; acnt=i if a[i] ansb: print("%d %d"%(ansa,ansb));print("A") if ansa bcnt: print("%d %d"%(ansa,ansb));print("A") if acnt 2020. 12. 18. [백준] 2506 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 import sys n=int(sys.stdin.readline()) ox=list(map(int, sys.stdin.readline().split())) if ox[0]==0: ans=0;cnt=0 else: ans=1; cnt=1 for i in range(1,n): if ox[i-1]==1: if ox[i]==1: cnt+=1; ans+=cnt else: cnt=0 else : if ox[i]==1: cnt+=1;ans+=1 else: cnt=0 print(ans) Colored by Color Scripter cs 2020. 12. 18. [백준] 2501 1 2 3 4 5 6 mylist=[] a,b= map ( int, input().split()) for i in range(1,a+1): if a%i==0: mylist.append(i) if b>len(mylist): print(0) else : print(mylist[b-1]) cs 2020. 12. 18. [백준] 2476 1 2 3 4 5 6 7 8 9 10 import sys n=int(sys.stdin.readline()) tmp=[] for _ in range(n): a,b,c=map(int,sys.stdin.readline().split()) if a==b==c: tmp.append(10000+a*1000) elif a==b or a==c : tmp.append(1000+100*a) elif b==c: tmp.append(b*100+1000) else : tmp.append(max(a,b,c)*100) print(max(tmp)) Colored by Color Scripter cs 2020. 12. 18. [백준] 2460 1 2 3 4 5 6 7 8 import sys ans=0 tmp=[] for i in range(10): a,b=map(int,sys.stdin.readline().split()) ans=ans-a+b tmp.append(ans) print(max(tmp)) cs 2020. 12. 18. [백준] 2455 1 2 3 4 5 6 7 8 import sys ans=0 tmp=[] for i in range(4): a,b=map(int,sys.stdin.readline().split()) ans=ans-a+b tmp.append(ans) print(max(tmp)) cs 2020. 12. 18. [백준] 2446 1 2 3 4 5 6 7 8 9 10 import sys n=int(sys.stdin.readline()) for i in range(n): for j in range(i): print(" ",end='') for j in range(2*(n-i)-1): print("*",end='') print("") for i in range(1,n): for j in range(n-i-1): print(" ",end='') for j in range(2*(i+1)-1): print("*",end='') if i!=n-1:print("") cs 2020. 12. 18. [백준] 2445 1 2 3 4 5 6 7 8 9 10 11 12 import sys n=int(sys.stdin.readline()) for i in range(1,n+1): for j in range(i): print("*",end='') for j in range(2*(n-i)): print(" ",end='') for j in range(i): print("*", end='') print("") for i in range(n-1): for j in range(n-i-1): print("*",end='') for j in range(2*(i+1)): print(" ",end='') for j in range(n - i - 1): print("*", end='') if i!=n-2:print("") cs 2020. 12. 18. [백준] 2444 1 2 3 4 5 6 7 8 9 10 import sys n=int(sys.stdin.readline()) for i in range(n-1): for j in range(n-i-1): print(" ",end='') for j in range(2*i+1): print("*",end='') print("") for i in range(n): for j in range(i): print(" ",end='') for j in range(2*(n-i-1)+1): print("*",end='') print("") Colored by Color Scripter cs 2020. 12. 18. [백준] 2443 1 2 3 4 5 6 import sys n=int(sys.stdin.readline()) for i in range(n): for j in range(i): print(" ",end='') for j in range(2*(n-i-1)+1): print("*",end='') print("") Colored by Color Scripter cs 2020. 12. 18. 이전 1 ··· 119 120 121 122 123 124 125 ··· 129 다음