← Back to List

27890번: 특별한 작은 분수 ↗

Solutions

Python 3
166 B | 166 chars
def f(x):
    if x & 1:
        return (x << 1) ^ 6
    else:
        return (x >> 1) ^ 6

x, n = map(int, input().split())

for i in range(n):
    x = f(x)
print(x)