본문 바로가기

python-algorithm1422

[백준] 10992 1 2 3 4 5 6 7 8 import sys n=int(sys.stdin.readline()) if n==1: print("*") else: print(" "*(n-1)+"*") for i in range(n -2): print (" "*(n-2-i)+"*"+" "*(2*i+1)+"*") print("*"*(2*n-1)) cs 2020. 12. 28.
[백준] 10991 1 2 3 4 5 6 7 8 9 import sys n=int(sys.stdin.readline()) if n==1: print("*") elif n==2: print(" *\n* *") else: print(" "*(n-1)+"*") print(" "*(n-2)+"* *") for i in range(n-2): print (" "*(n-3-i)+"* "*(i+2)+"*") cs 2020. 12. 28.
[백준] 10990 1 2 3 4 5 6 7 8 import sys n=int(sys.stdin.readline()) if n==1: print("*") elif n==2: print(" *\n* *") else: print(" "*(n-1)+"*") for i in range(n-1): print(" "*(n-i-2) +"*"+" "*(2*i+1)+"*") cs 2020. 12. 28.
[백준] 10951 1 2 3 4 5 6 while True: try: a,b =map(int, input().split()) print(a+b) except: break cs 2020. 12. 28.
[백준] 10871 1 2 3 4 5 6 a,b=map(int, input().split()) tmp=list(map(int,input().split())) ans=[] for i in range(a): if tmp[i] 2020. 12. 28.
[백준] 10833 1 2 3 4 5 6 import sys cnt=0 for _ in range (int(sys.stdin.readline())): a,b=map(int,sys.stdin.readline().split()) cnt+=b%a print(cnt) Colored by Color Scripter cs 2020. 12. 28.
[백준] 10824 1 2 3 import sys a,b,c,d=sys.stdin.readline().split() print( int (a+b)+int(c+d) ) cs 2020. 12. 28.
[백준] 10818 1 2 3 4 5 N=int(input()) a=list(map(int,input().split())) a.sort() print("%d %d"%(a[0],a[-1])) cs 2020. 12. 28.
[백준] 10817 1 2 tmp=list(map(int, input().split())) print((sorted(tmp))[1]) cs 이게 지금 난이도 브론즈2 로 책정돼있는데.. 흠 3,4로 낮춰도 될 것 같아요 쉽습니다. 2020. 12. 28.
[백준] 10599 1 2 3 4 5 import sys while True: a,b,c,d=map(int, sys.stdin.readline().split()) if a==b==c==d==0 :exit() print(c-b,d-a) Colored by Color Scripter cs 2020. 12. 28.
[백준] 10569 1 2 3 4 import sys for _ in range(int(sys.stdin.readline())): v,e=map(int, sys.stdin.readline().split()) print(e-v+2) cs 초등학교때 아마 다면체 꼭짓점의수 - 모서리의수 + 면의 수 =2 라는게 나왔던거 같은데 이 내용이 문제에 포함이 안됐다면 쪼끔 생각하기 어려웠을 수도 있다고 생각합니다 2020. 12. 28.
[백준] 10539 1 2 3 4 5 6 7 8 9 10 import sys n=int(sys.stdin.readline()) b=list(map(int,sys.stdin.readline().split())) a=[b[0]] for i in range(1,n): a.append( (i+1)*b[i]-sum(a[:i]) ) for _ in range(n): print(a[_], end=' ') cs 2020. 12. 28.