Advertisement
Guest User

Untitled

a guest
Mar 17th, 2018
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. Alice and Bob are playing a new game of stones. There are N stones placed on the ground, forming a sequence. The stones are labeled from 1 to N.
  2.  
  3. Alice and Bob in turns take exactly two consecutive stones on the ground until there are no consecutive stones on the ground. That is, each player can take stone i and stone i+1, where 1≤i≤N−1. If the number of stone left is odd, Alice wins. Otherwise, Bob wins.
  4.  
  5. Assume both Alice and Bob play optimally and Alice plays first, do you know who the winner is?
  6.  
  7. Input
  8. The input contains an integer N (1≤N≤10000000), the number of stones.
  9.  
  10. Output
  11. Output the winner, “Alice” or “Bob” (without the quotes), on a line.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement