取石子游戏
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4636 Accepted Submission(s): 2450
2 1 8 4 4 7
0 1 0
#pragma comment(linker, "/STACK:1024000000,1024000000")
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<queue>
#include<stack>
#include<vector>
#include<set>
#include<map>
#define L(x) (x<<1)
#define R(x) (x<<1|1)
#define MID(x,y) ((x+y)>>1)
#define bug printf("hihi\n")
#define eps 1e-7
typedef __int64 ll;
using namespace std;
#define INF 10005
#define N 200005
int main()
{
int i,j,n,m;
while(~scanf("%d%d",&n,&m))
{
if(n<m) swap(n,m);
int k=n-m;
n=(int)(k*((1+sqrt(5.0))/2));
if(n==m)
printf("0\n");
else
printf("1\n");
}
return 0;
}
5万+



被折叠的 条评论
为什么被折叠?



