Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:Problem in English PLS!!!!!!!!!!!

Posted by fandingmh at 2009-07-06 10:53:49 on Problem 1067
In Reply To:Problem in English PLS!!!!!!!!!!! Posted by:h1x40 at 2009-07-01 18:58:26
Description

There are two piles of stones, and each pile contains a random number of stones. The game is played by two people taking away stones in turn. The game defines two ways to take away stones. The first way is to take away an arbitrary number of stones from one file, and the other way is to take away the same number of stones from both piles. The person who does the last "take away" is the winner. Given the numbers of stones of the two piles, can you win the game if you do the first "take away" in the game? Assume that each player adopts the best strategy.

Input

Input contains several lines containg the initial state of the two piles of stones. Each line will be two non-negative integer a, b, representing the numbers of the two piles of stones. a, b <= 1,000,000,000。

Output

Output 1 if you win, 0 otherwise。
Sample Input

2 1
8 4
4 7
Sample Output

0
1
0
Source

NOI

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator