-
[python]백준 배고파(Easy) 28239번알고리즘 문제풀이/백준(파이썬) 2023. 6. 19. 23:27
코드
import sys import math sys.stdin = open("28239.txt", "r") t=int(input()) for i in range(t): q=int(input()) w = int(math.log2(q)) for i in range(w + 1): for j in range(i, w + 1):#0~w+1 # 처음 2^0 2^0 if 2**i + 2**j == q: print(i,j)
링크
https://www.acmicpc.net/problem/28239
'알고리즘 문제풀이 > 백준(파이썬)' 카테고리의 다른 글
[python]백준 얼마? 9325번 (0) 2023.06.20 [python]백준 점수 집계 9076번 (0) 2023.06.20 [python]백준 코드마스터 2023 28235번 (0) 2023.06.18 [python]백준 조합 0의 개수 2004번 (0) 2023.06.17 [python]백준 Who is in the middle? 6840번 (0) 2023.06.16