(
d
o
u
b
l
e
)
a
b
s
(
b
−
a
)
∗
(
1.0
+
s
q
r
t
(
5.0
)
)
/
2.0
=
=
m
i
n
(
a
,
b
)
(double)abs(b-a)*(1.0+sqrt(5.0))/2.0 ==min(a,b)
(double)abs(b−a)∗(1.0+sqrt(5.0))/2.0==min(a,b)
先手输,否则后手赢
https://blog.csdn.net/qq_41311604/article/details/79980882
#include <iostream>
#include <stdio.h>
#include <math.h>
using namespace std;
int main()
{
long long n, m;
double x = (1.0 + sqrt(5.0)) / 2.0;
while(scanf("%lld %ld",&n, &m)!=EOF)
{
if (n > m){
long long t = m;
m = n;
n = t;
}
long long res = (m-n)*x;
if (res == n) printf("0\n");
else printf("1\n");
}
return 0;
}