https://www.acmicpc.net/problem/5940
5940번: Math Practice
One lovely afternoon, Bessie's friend Heidi was helping Bessie review for her upcoming math exam. Heidi presents two integers A (0 <= A <= 45) and B (1 <= B <= 9) to Bessie who must respond with an integer E in the range 1..62. E is the smallest integer in
www.acmicpc.net
1
2
3
4
5
6
7
8
9
10
11
|
def sol(a, b):
answer = 0
for i in range(a+1, 63):
if int(str(2**i)[0]) == b:
return i
return answer
if __name__ == '__main__':
a, b= map(int, input().split())
print(sol(a, b))
|
cs |
반응형
'python-algorithm' 카테고리의 다른 글
백준 26040 특정 대문자를 소문자로 바꾸기 (0) | 2022.12.07 |
---|---|
백준 6976 Divisibility by 11 (0) | 2022.12.07 |
백준 9713 Sum of Odd Sequence (0) | 2022.12.06 |
백준 26041 비슷한 전화번호 표시 (0) | 2022.12.06 |
백준 6500 랜덤 숫자 만들기 (0) | 2022.12.06 |
댓글