본문 바로가기

분류 전체보기1523

[백준] 6322 1 2 3 4 5 6 7 8 9 10 11 12 13 14 import sys import math cnt=1 while True: a,b,c=map(int,sys.stdin.readline().split()) if a==b and b==c and a==0: break elif (a>=c or b>=c) and c!=-1 : print("Triangle #%d"%cnt); print("Impossible.") elif a==-1: print("Triangle #%d"%cnt); print("a = %.3f"% (math.sqrt(pow(c,2)-pow(b,2)))) elif b == -1: print("Triangle #%d" % cnt); print("b = %.3f" % (math.sqrt(pow(c.. 2020. 12. 24.
[백준] 6131 1 2 3 4 5 6 7 import sys n=int(sys.stdin.readline()) cnt=0 for i in range(1,501): for j in range(1,501): if pow(j,2)+n==pow(i,2): cnt+=1 print(cnt) cs 2020. 12. 24.
[백준] 5717 1 2 3 4 5 import sys while True: a,b=map(int, sys.stdin.readline().split()) if a==0 and b==0: break else: print(a+b) cs 2020. 12. 24.
[백준] 5612 1 2 3 4 5 6 7 8 9 10 11 12 import sys n=int(sys.stdin.readline()) tmp=[] tmp.append(int(sys.stdin.readline())) for i in range(n): a,b=map(int,sys.stdin.readline().split()) tmp.append( tmp[i]+a-b) for i in range(n+1): if tmp[i] 2020. 12. 23.
[백준] 5523 1 2 3 4 5 6 7 8 import sys cnta=0 cntb=0 for _ in range(int(sys.stdin.readline())): a,b=map(int,sys.stdin.readline().split()) if a>b: cnta+=1 elif a 2020. 12. 23.
[백준] 5361 1 2 3 4 import sys for _ in range(int(sys.stdin.readline())): a,b,c,d,e=map(int, sys.stdin.readline().split()) print("$%.2f"%(a*350.34+b*230.90+c*190.55+d*125.30+e*180.90)) cs 이 문제가 왜 브론즈3인지는 이해가 되질 않네요 2020. 12. 23.
[백준] 5086 1 2 3 4 5 6 7 import sys while True: a,b=map(int, sys.stdin.readline().split()) if (a,b)== (0,0): break elif b%a==0: print("factor") elif a%b==0: print("multiple") else : print("neither") cs 2020. 12. 23.
[백준] 5073 1 2 3 4 5 6 7 8 import sys while True: a,b,c=map(int, sys.stdin.readline().split()) if a==0 and b==0 and c==0: break elif (a+b+c -max(a,b,c)) 2020. 12. 23.
[백준] 4892 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 import sys cnt=1 while True: n0=int(sys.stdin.readline()) if n0==0: break else: n1=n0*3 if n1%2==0: n2=int (n1/2) else: n2= int ( (n1+1)/2) n3=3*n2 n4= int (n3/9) if n1%2==1: print("%d. odd %d"%(cnt,n4)) else: print("%d. even %d"%(cnt,n4)) cnt+=1 Colored by Color Scripter cs 2020. 12. 23.
[백준] 4880 1 2 3 4 5 6 import sys while True: a,b,c= map(int, sys.stdin.readline().split()) if a ==b and b==c and a==0: break if c-b==b-a: print("AP %d"%(c+c-b)) elif c//b==b//a : print("GP %d"%(c*c/b)) cs 등차수열, 등비수열 생각해보시면 금방 풀 수 있습니다! 2020. 12. 23.
[백준] 4766 1 2 3 4 5 6 7 import sys tmp=float(sys.stdin.readline()) while True: n=float(sys.stdin.readline()) if int (n)==999: break print("%.2f"%(n-tmp)) tmp=n cs tmi: pnu cse는 일반 화학 실험을 하지 않는다. 2020. 12. 23.
[백준] 4690 1 2 3 4 5 6 7 for a in range (2,101): for b in range(2, 101): for c in range(2, 101): for d in range(2, 101): if pow(a,3)==pow(b,3)+pow(c,3)+pow(d,3): if b 2020. 12. 23.