原題鏈接:http://poj.org/problem?id=1067
Time Limit: 1000MS | Memory Limit: 10000K | |
Total Submissions: 44733 | Accepted: 15227 |
Description
Input
Output
Sample Input
2 1 8 4 4 7
Sample Output
0 1 0
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
using namespace std;
const int maxn = 105;
int main(){
int a, b;
while(~scanf("%d%d", &a, &b)){
if(a > b) swap(a, b);
double m = (sqrt(5.0)+1)/2;
int k = b-a;
if(a == (int)(k*m)){
cout<<"0"<<endl;
}
else cout<<1<<endl;
}
}