Hackerrank solutions.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

18 lines
312 B

#!/usr/bin/python3
# https://www.hackerrank.com/challenges/utopian-tree
import sys
def calcsize(cycles):
tmp = 2**((cycles+3)//2)
if cycles % 2 == 1:
return tmp - 2
return tmp - 1
def main():
total = int(sys.stdin.readline())
for i in range(total):
print(calcsize(int(sys.stdin.readline())))
main()