Skip to content

Baekjoon 1740

1. Problem

문제 확인하기

2. Solution

n = int(input())
s = []
num = 0
while n > 0:
    s.append(n % 2)
    n //= 2
for i in range(len(s)):
    if s[i] == 1:
        num += 3 ** i
print(num)