DCP-282: Binary Game Back to All Problems

Medium Game Theory > Observations/Pattern finding

Alice and Bob always loves to play different games.One day, they were not finding any game to play and so they were feeling disappointed. Suddenly, they found a book in their room with a binary number written onto it, the length of which was not longer than **33**. Then, They formulate the game rule, say "**Binary Game**". In this game, the first player chooses a pair of indexes of the binary string and **reverses the substring generated by it** ,so that the string will become **lexicographically minimum among all possible selections of indices pairs**, and give it to second player. Then, second player do the same thing on the string and give it back to first player. This process continues untill there is no way to make binary string lexicographically smaller than before. The player who can not make the move will losses the game. Today, Alice and Bob are playing the Binary Game in their room. Suddenly, you enter into their room. Now, Your task is to determine the winner of the game if both of them play in well disciplined manner and the first player of the game is "**Alice**". Input: ------ Input starts with an integer **T (1<=T<=100000)**, denoting the number of test cases. Each case contains a binary string probably with leading zeros, which is a binary integer number in the range of **33 bit number**. Output: ------- For each case of input, output the name of the winner of the game. Sample Input ------------ 3 00 01 10 Sample Output ------------- Bob Bob Alice

Problem Setter:

Bishal Gautam

Please login to submit solution to this problem.

Problem Limits

Language Time Limit (seconds)
C 1.00
C++ 1.00
C++14 1.00
C# 2.00
Go 2.00
Java 2.00
JavaScript 2.00
Objective-C 2.00
Perl 2.00
PHP 2.00
Python 2.00
Python3 2.00
Ruby 2.00
VB.Net 2.00

Problem Stats




# User Language Timing
01 feodorv Cpp14 0.04s
02 Robbinb1993 Cpp 0.04s
03 ____ C 0.05s
04 Morass Cpp14 0.05s
05 prottoy919 Cpp14 0.05s
06 PKP_007 Cpp14 0.05s
07 adamantium Cpp14 0.05s
08 as_couple Cpp14 0.05s
09 njrafi Cpp14 0.05s
10 I_See_You Cpp14 0.07s
11 imranziad Cpp14 0.07s
12 kitorp Cpp14 0.07s
13 abinash Cpp14 0.15s
14 maxhasan Cpp14 0.16s
15 KAMO1 Cpp14 0.18s
16 DynamicOvi Cpp14 0.19s
17 chayan_JU Cpp14 0.25s
18 Arpan_cse_2k14 Cpp14 0.26s
19 tariqiitju Cpp 0.27s
20 mno123 Cpp14 0.31s
21 souravvv Cpp14 0.31s
22 nuhu_iu Cpp14 0.31s
23 moshiur_cse15 Cpp14 0.32s
24 astrolion7 Cpp14 0.33s
25 pin2paul Cpp14 0.33s
26 priojeet_priyom Cpp14 0.34s
27 Mohaimin66 Cpp14 0.34s
28 seyedssz Cpp14 0.37s
29 sahedsohel Cpp14 0.37s
30 swapnilsaha Cpp14 0.40s
31 emrul Cpp14 0.43s
32 rayhan50001 Cpp 0.49s
33 sayedgkm Cpp14 0.50s
34 xpo6 Cpp14 0.64s
35 RezwanArefin01 Cpp14 0.71s
36 shaft Cpp14 0.79s
37 Tanmoy1228 Cpp14 0.93s
38 ksohan Cpp14 0.96s

Your feedback is our precious!

Or call +88 02 9853138 for support