#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <algorithm>
using namespace std;
int gcd(int a, int b) {
return b == 0 ? a : gcd(b, a % b);
}
int main() {
int ok = 1;
int a, b, n, d;
cin >> a >> b >> n;
while(n > 0) {
d = gcd(a, n);
n -= d;
ok ^= 1;
swap(a, b);
}
cout << ok << endl;
return 0;
}
119A - Epic Game
最新推荐文章于 2019-01-24 13:14:28 发布