https://vjudge.net/contest/166094#problem/H
猜测样例写的过了。。没怎么搞明白概率什么鬼。
看题解。
k个黑球,1个红球,问你取红,先手是否有优势。
什么鬼的优势。。就是赢得概率
没一回合概率都是 1/(k+1),如果是奇数,那么概率相同。(奇数是偶数个球啊-.-)
偶数就一样。。
#include <iostream>
#include <cstdio>
using namespace std;
int main()
{ int n;
while(~scanf("%d",&n))
{ if(n==0)
puts("2");
if(n%2==0)
puts("1");
else if(n%2==1)
puts("0");
}
return 0;
}