def XXX(n):
if n == 0:
return 1
elif n % 2 == 1:
return XXX(n - 1) * 2
else:
return XXX(n // 2) ** 2
n=int(input())
print(XXX(n))
-------------------
16
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
def XXX(n):
if n == 0:
return 1
elif n % 2 == 1:
return XXX(n - 1) * 2
else:
return XXX(n // 2) ** 2
n=int(input())
print(XXX(n))
-------------------
16
-------------------