Skip to content

Instantly share code, notes, and snippets.

@modos
Created October 18, 2022 08:16
Show Gist options
  • Save modos/1dbf395ee236895c939fae905c44f8f6 to your computer and use it in GitHub Desktop.
Save modos/1dbf395ee236895c939fae905c44f8f6 to your computer and use it in GitHub Desktop.
شرکت‌های هرمی در برره
h,a=input().split()
h=int(h)
b=0
for i in a:
b*=2
if i=='R':
b+=0
else:
b+=1
for i in range(h-len(a)):
b+=2**(h-i)
print(b+1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment