python-algorithm1422 [백준] 18005 1 2 3 4 5 6 n=int(input()) if n%2==0: if (n//2)%2==1: print(1) else: print(2) else: print(0) cs n개만큼 연속하는 숫자의 합이 홀수인지 짝수인지 아니면 n에따라 홀짝 둘다 가능한지 묻는 문제입니다. n이1일때부터 7~8정도 까지 손으로 그려보시면 금방 구현가능합니다. 2021. 3. 8. [백준] 17874 1 2 3 n,h,v=map(int,input().split()) ans=max(h*v,h*(n-v),(n-h)*v,(n-h)*(n-v)) print(4*ans) cs 2021. 3. 8. [백준] 17863 1 2 3 s=input() if s[0:3]=='555' :print("YES") else: print("NO") cs 2021. 3. 8. [백준] 17009 1 2 3 4 5 6 7 8 9 10 11 scorea,scoreb=0,0 scorea+=int(input())*3 scorea+=int(input())*2 scorea+=int(input())*1 scoreb+=int(input())*3 scoreb+=int(input())*2 scoreb+=int(input())*1 if scorea>scoreb:print("A") elif scorea==scoreb:print("T") else:print("B") cs 농구 점수 계산이네요 2021. 3. 8. [백준] 16785 1 2 3 a,b,c=map(int,input().split()) for i in range(1,c//a+2): if a*i+(i//7)*b>=c: print(i); break cs line2에서 range의 범위를 c//a+2 까지 하는 이유: 예제 1로 예를들면 하루에 코인 3개인데 최소 10개를 확보하려면 최소 4번을 로그인 해야됩니다. 수식으로하면 c//a+1 이 되겠죠 하지만 range는 ~~까지 기때문에 range(1,4)라고 해버리면 i가 3에서 끝납니다. 따라서 c//a+1+1 즉 c//a+2까지 반복문의 범위를 설정해주셔야합니다. 2021. 3. 8. [백준] 16727 1 2 3 4 5 6 7 8 p1,s1=map(int,input().split()) s2,p2=map(int,input().split()) if p1+p2 > s1+s2 :print("Persepolis") elif p1+p2 p2:print("Esteghlal") elif s1 2021. 3. 8. [백준] 16693 1 2 3 4 5 6 import sys import math a1,p1=map(int, sys.stdin.readline().split()) r1,p2=map(int, sys.stdin.readline().split()) if a1/p1 2021. 3. 8. [백준] 16600 1 2 3 4 import sys import math n=int(sys.stdin.readline()) print(4*math.sqrt(n)) cs 2021. 3. 8. [백준] 16017 1 2 3 4 5 6 7 8 9 10 a=int(input()) b=int(input()) c=int(input()) d=int(input()) chk=0 if a==8 or a==9: if d==8 or d==9: if b==c: chk=1 if chk==1: print('ignore') else: print('answer') cs 2021. 3. 5. [백준] 15963 1 2 3 a,b=map(int, input().split()) if a==b: print(1) else: print(0) cs 2021. 3. 5. [백준] 15610 1 2 3 import math n=int(input()) print(4*math.sqrt(n)) cs 문제를 간단히 정의하면 입력값이 정사각형의 넓이고 출력값은 둘레 입니다. 2021. 3. 5. [백준] 15474 1 2 3 import math n,a,b,c,d=map(int, input().split()) print(min( math.ceil(n/a)*b , math.ceil(n/c)*d)) cs 문제 보고 바로 이해가 안되시면 힌트 보시면 구현하는데 도움될듯싶습니다. 2021. 3. 5. 이전 1 ··· 74 75 76 77 78 79 80 ··· 119 다음