Choose Your Plank
All submissions for this problem are available.There is a famous gift shop in Jaipur and it manufactures one special kind of showpiece only once in a year(and one in number only), and they have many rounds of exciting games among its customer to decide the actual buyer of this product but this time it was a tie between two so the owner of the shop decided for a tiebreaker game to find out the winner. In the game, there were $N$ wooden planks kept in a row (The height of the ith plank is greater than or equal to the height of the previous plank). At every turn a player will select a number (height of the plank), if there are multiple occurrences of that plank then the first one among them and all the planks before it (index wise) are removed. The player who removes the last plank will be declared as the winner. If the array looks like $[1,1,1,2,2,2]$ and you remove $2$ then first four elements are removed as the first occurrence of element 2 is at 4th position. Now both the customers A and B play optimally, your task is to find out the winner if customer A starts first and they alternate in turns. ###Input: - Firstline will contain $N$, denoting the number of planks. Second line of the input contains $N$ spaced integers( denoting the height of the wooden plank $X$ in the order they are arranged). ###Output: output in a single line "Customer-A", if A wins the game and "Customer-B", if B wins the game. (C, A, B are in uppercase). ###Constraints - $1 \leq N \leq 10^5$ - $1 \leq X \leq 10^7$ ###Sample Input: 5 1 1 2 3 8 ###Sample Output: Customer-A ###EXPLANATION: There are two planks of height one followed by two planks of height 2,3 and 8 respectively and customer A starts the game so if he chooses the plank with height 8 then all the planks are removed and no planks are left for the Customer B, so A wins the game.
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, 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, SQL, kotlin, PERL6, TEXT, SCM chicken, PYP3, CLOJ, R, COB, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.