DCP-540: Pile game 1 Back to All Problems

Beginner Game Theory > Observations/Pattern finding


Alice and Bob are playing a new pile game. Initially on the table, there are **N** piles. Each time, the player has to take **2^i** piles **(i ≥ 0)**. The winner is the one who takes the last pile. Alice starts first, and you need to find the winner of the game if both of them play optimally well. Input: ------ Input starts with an integer **T (1<=100)**, denoting the number of test cases. Each test case contains an integer **N (1 ≤ N ≤ 10^9)** denoting the number of piles on the table. Output: ------- For each test, print **"First"** if Alice wins, and **"Second"** otherwise. Sample Input ------------ 2 2 3 Sample Output ------------- First Second


Problem Setter:

Mahmud Allahverdiyev

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

88/426

Solve/Submission

Ranking

# User Language Timing
01 dipta007 Cpp 0.00s
02 sohelcseiu Cpp 0.00s
03 mahbubcseju Cpp 0.00s
04 imranziad Cpp 0.00s
05 ksohan Cpp 0.00s
06 ssavi Cpp 0.00s
07 subhashis_cse Cpp 0.00s
08 Zayed Cpp 0.00s
09 mhiceiuk Cpp 0.00s
10 Jisancse Cpp 0.00s
11 tariqiitju Cpp 0.00s
12 Pure_Protea Cpp14 0.00s
13 robin_aust Cpp 0.00s
14 Arpan_cse_2k14 Cpp 0.00s
15 maf_uu Cpp 0.00s
16 prodipdatta7 Cpp14 0.00s
17 Sarwar05 Cpp 0.00s
18 Indrjit_BU Cpp 0.00s
19 moshiur_cse15 Cpp 0.00s
20 rayhan50001 Cpp 0.00s
21 IIUC_minhazmiraz Cpp14 0.00s
22 Arif_Shariar Cpp 0.00s
23 Riad_IIT7 Cpp 0.00s
24 nahid08 Cpp 0.00s
25 Rajan_sust Cpp14 0.00s
26 unknown420 Cpp 0.00s
27 Ishraq_Nibir Cpp 0.00s
28 hrOarr Cpp 0.00s
29 DynamicOvi Cpp 0.00s
30 Bisnu039 Cpp 0.00s
31 Bruteforcekid Cpp 0.00s
32 mh755628 Cpp 0.00s
33 loser_123 Cpp 0.00s
34 Ataur Cpp 0.00s
35 Shirsho Cpp 0.00s
36 Chucks Cpp 0.00s
37 aaman007 Cpp 0.00s
38 PKP_Junior Cpp 0.00s
39 anik_ewu Cpp14 0.00s
40 kamran_11b Cpp 0.00s
41 Frdhsn Cpp14 0.00s
42 wajiul Cpp 0.00s
43 muradhossen Cpp 0.00s
44 Riaz_BSMRSTU Cpp 0.00s
45 shuvo_mbstu Cpp 0.00s
46 Zihad Cpp 0.00s
47 sazal24_7 Cpp 0.00s
48 ehsan_sshuvo96 Cpp 0.00s
49 pencil Cpp 0.00s
50 Urmy_Cse_Brur C 0.00s
Feedback

Your feedback is our precious!



Or call +88 02 9853138 for support