All submissions for this problem are available.
So, you are bored and you think about playing a game. The game is like, if you win your money will be
doubled and eleven dollars extra will be added to it. If you lose, your money will be halved (if the
amount is odd, it will be halved to the upper integer). The inital amount of money you have is 'X'. A
sequence of W and L are given as input, and 'X' is given initially. You have to find the amount of money
remaining with you at the end of the game.
The first line contains a single integer X denoting the amount of money you initially have.
The second line contains a sequence of characters of W and L representing Win and Loss respsectively.
output a single line containing the amount you have at the end of the game.
- Length of sequence ≤ 1000
Input #1: 51 L Output #1: 26 Input #2: 23 LWLW Output #2: 47
Example case 1. The game is a loss. So, the amount of money is to be halved.
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, CLOJ, FS|
Fetching successful submissions