DCP-426: Easy Game Back to All Problems

Medium Game Theory > Nim

Alice and Bob are playing a game. They have a string , say **S** consisting of lowercase alphabets. Alice always starts first. In each step, they chooses an index and changes the character at that index to lowercase alphabet letter which is lexicographically smaller than previous one. So, they can not make a move if character of the index is '**a**'. One who can not make any move losses the game. Your task is to print the name of the winner of the game if both of them play optimally well. Input: ------ Input starts with an integer **T (1<=T<=20)**, denoting the number of test cases. Each case contains a non-empty string **S**. The length of **S** do not exceed **1000** and **S** consists only of lowercase english alphabets. Output: ------- For each case of input, output the winner of the game either "**Alice**" or "**Bob**". Sample Input ------------ 1 abcdef Sample Output ------------- 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 Reayz Cpp 0.00s
02 Foysol_Ahmed Cpp 0.00s
03 Superstorm Cpp14 0.00s
04 amani_LU Cpp 0.00s
05 Bruteforcekid Cpp14 0.00s
06 Arpan_cse_2k14 Cpp 0.00s
07 by_default Cpp 0.00s
08 Jisancse Cpp 0.00s
09 Mr_adnan Cpp 0.00s
10 AlaminJust Cpp 0.00s
11 nabil1997 Cpp 0.00s
12 Hasnaine Cpp 0.00s
13 Rajan_sust Cpp14 0.00s
14 mahade31 Cpp14 0.00s
15 Najat Cpp 0.00s
16 ssavi Cpp 0.00s
17 aaman007 Cpp 0.00s
18 baibhavbista Cpp 0.00s
19 Islam_Rafat Cpp 0.00s
20 anikatahsin Cpp 0.00s
21 feodorv C 0.00s
22 ittehad Cpp 0.00s
23 mhiceiuk Cpp 0.00s
24 robin_aust Cpp 0.00s
25 clkjwdhc Cpp 0.00s
26 tariqiitju Cpp 0.01s
27 pulak_ict_mbstu Cpp14 0.01s
28 monir769 Cpp14 0.01s
29 ehsan_sshuvo96 Cpp 0.01s
30 a_rahman Cpp 0.01s
31 seyedssz Cpp14 0.01s
32 Pure_Protea Cpp14 0.01s
33 kissu_pari_na Cpp14 0.01s
34 rayhan50001 Cpp 0.01s
35 badhansen123 Cpp 0.01s
36 saiful130104 Cpp 0.01s
37 IIUC_minhazmiraz Cpp 0.01s
38 mehedi_01 Cpp14 0.01s
39 Taran Cpp 0.01s
40 belal_mbstu Cpp14 0.01s
41 aarifshuvo Cpp 0.01s
42 DynamicOvi Cpp 0.01s
43 leonelshovo Cpp 0.01s
44 murshed Cpp 0.01s
45 The_mover Cpp 0.01s
46 anik_JU Cpp 0.01s
47 rakib_cou Cpp 0.01s
48 indroneel Cpp14 0.01s
49 introverted Cpp 0.01s
50 CLown1331 Cpp14 0.01s

Your feedback is our precious!

Or call +88 02 9853138 for support