Created
October 18, 2022 08:16
-
-
Save modos/1dbf395ee236895c939fae905c44f8f6 to your computer and use it in GitHub Desktop.
شرکتهای هرمی در برره
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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