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 nabil1997 Cpp 0.00s
02 ssavi Cpp 0.00s
03 anikatahsin Cpp 0.00s
04 mhiceiuk Cpp 0.00s
05 Jisancse Cpp 0.00s
06 Foysol_Ahmed Cpp 0.00s
07 robin_aust Cpp 0.00s
08 Arpan_cse_2k14 Cpp 0.00s
09 Najat Cpp 0.00s
10 Superstorm Cpp14 0.00s
11 Mr_adnan Cpp 0.00s
12 Reayz Cpp 0.00s
13 Islam_Rafat Cpp 0.00s
14 ittehad Cpp 0.00s
15 feodorv C 0.00s
16 AlaminJust Cpp 0.00s
17 Rajan_sust Cpp14 0.00s
18 aaman007 Cpp 0.00s
19 Bruteforcekid Cpp14 0.00s
20 mahade31 Cpp14 0.00s
21 clkjwdhc Cpp 0.00s
22 by_default Cpp 0.00s
23 baibhavbista Cpp 0.00s
24 Hasnaine Cpp 0.00s
25 amani_LU Cpp 0.00s
26 murshed Cpp 0.01s
27 introverted Cpp 0.01s
28 ehsan_sshuvo96 Cpp 0.01s
29 mehedi_01 Cpp14 0.01s
30 rakib_cou Cpp 0.01s
31 kissu_pari_na Cpp14 0.01s
32 monir769 Cpp14 0.01s
33 indroneel Cpp14 0.01s
34 DynamicOvi Cpp 0.01s
35 seyedssz Cpp14 0.01s
36 leonelshovo Cpp 0.01s
37 anik_JU Cpp 0.01s
38 belal_mbstu Cpp14 0.01s
39 a_rahman Cpp 0.01s
40 Taran Cpp 0.01s
41 IIUC_minhazmiraz Cpp 0.01s
42 Pure_Protea Cpp14 0.01s
43 saiful130104 Cpp 0.01s
44 rayhan50001 Cpp 0.01s
45 The_mover Cpp 0.01s
46 aarifshuvo Cpp 0.01s
47 pulak_ict_mbstu Cpp14 0.01s
48 tariqiitju Cpp 0.01s
49 badhansen123 Cpp 0.01s
50 CLown1331 Cpp14 0.01s

Your feedback is our precious!

Or call +88 02 9853138 for support