본문 바로가기

백준1056

[백준] 14935 1 print("FA") cs 손으로 해보니까 모든 경우가 반복됩니다 2021. 3. 5.
[백준] 14264 1 2 3 import math l=int(input()) print(l*l*math.sqrt(3)/4 ) cs 끼인각과 양 변의 길이를 알때 삼각형의 넓이 구하는 식을 통해 구현 했습니다. 2021. 3. 5.
[백준] 14038 1 2 3 4 5 6 7 cnt=0 for _ in range(6): if input()=='W' : cnt+=1 if cnt>4:print(1) elif cnt>2: print(2) elif cnt>0: print(3) else: print(-1) cs 입력받은 문자열 카운팅해서 조건에 따라 출력하면 됩니다 쉬움. 2021. 3. 5.
[백준] 13985 1 2 3 tmp=list(input().split()) if int(tmp[0])+int (tmp[2])==int(tmp[4]): print("YES") else: print("NO") Colored by Color Scripter cs 입력중에 다른 사칙 연산이 있다면 eval 연산 쓰시는게 좋아보이네요 2021. 3. 5.
[백준] 13597 1 2 3 a,b=map(int, input().split()) if a==b : print(a) else : print(max(a,b)) cs 포커의 족보 생각하시면 구현하는데 도움 되실겁니다. 2021. 3. 5.
[백준] 13311 1 print(-1) cs 음.. 이건 구현보다는 수학적인 내용을 잘 생각하셔야 구할수 있습니다. 문제에서 432자리 이내의 숫자라고 해서 겁먹지 마시고 천천히 modular 의 개념을 생각해보시고 음수의 나눗셈 생각해보시면 쉽게 구합니다. 2021. 3. 4.
[백준] 13136 1 2 3 import math a,b,c=map(int,input().split()) print( math. ceil(a/c)* math.ceil(b/c)) cs 2021. 3. 4.
[백준] 11549 1 2 3 n=int(input()) tmp=list(map(int,input().split())) print(tmp.count(n)) cs 2021. 3. 4.
[백준] 11282 1 2 n=int(input()) print(chr(n+44031)) cs '가'의 아스키코드 값이 44032 이고 이걸 이용하면 쉽게 풀수 있습니다. 2021. 3. 4.
[백준] 9524 1 2 3 4 5 n=int(input()) if n==1:print(1) if n==2:print(7) if n==3:print(2) if n==4:print(3) cs Yekaterinbug 가 설립된(?) 된 연도의 각 자리수를 출력하면됩니다. 라고 하네요 2021. 3. 4.
[백준] 8723 1 2 3 4 tmp=sorted(map(int, input().split())) if tmp[0]== tmp[1] and tmp[1]==tmp[2]: print(2) elif tmp[0]**2+tmp[1]**2==tmp[2]**2: print(1) else: print(0) Colored by Color Scripter cs 주어진 세 숫자가 정삼각형인지 , 직각삼각형인지 구분하는 문제고 line 1에서 sorted를 쓴 이유는 세 숫자가 오름차순이거나 내림차순인지 모르기 때문에 씁니더 2021. 3. 4.
[백준] 8710 1 2 3 4 a,b,c=map(int, input().split()) ans=b-a if ans%c ==0: print(ans//c) else: print(ans//c +1) cs 처음에는 while로 구현했는데 시간초과나와서 간단한 사칙연산으로 바꿔 구현했습니다. 2021. 3. 4.