1050.Epic Game
提交状态 耗时 内存 语言 提交时间

1050.Epic Game

时间限制:1000MS  内存限制:65535KB
题目描述
Simon and Antisimon play a game. Initially each player receives one fixed positive integer that doesn't change throughout the game. Simon receives number a and Antisimon receives number b. They also have a heap of n stones. The players take turns to make a move and Simon starts. During a move a player should take from the heap the number of stones equal to the greatest common divisor of the fixed number he has received and the number of stones left in the heap. A player loses when he cannot take the required number of stones (i. e. the heap has strictly less stones left than one needs to take). 
 
Your task is to determine by the given a, b and n who wins the game.
 
输入描述
The only string contains space-separated integers a, b and n (1≤a,b,n≤100) — the fixed numbers Simon and Antisimon have received correspondingly and the initial number of stones in the pile.
输出描述
If Simon wins, print "0" (without the quotes), otherwise print "1" (without the quotes).
示例
输入样例
3 5 9
1 1 100
输出样例
0
1
提示
相关标签
登陆后才可以提交
测试输入
执行结果
控制台
代码编辑器配置
  • 字体设置
    调整适合你的字体大小。
  • 主题设置
    切换不同的代码编辑器主题,选择适合你的语法高亮。
  • 行宽限制
    设置每一行代码的最大字符个数,设置为0则不限制。