fork(2) download
  1. #include <cstdio>
  2. using namespace std;
  3.  
  4. inline int gcd(int a, int b){
  5. while(b) b ^= a ^= b ^= a %= b;
  6. return a;
  7. }
  8.  
  9. int main()
  10. {
  11. int a, b, c;
  12. scanf("%d %d", &a, &b);
  13. c = (a + b)/gcd(a, b);
  14. printf("%d\n", (a == b || c == (c & (-c))));
  15. return 0;
  16. }
  17.  
Success #stdin #stdout 0s 3100KB
stdin
Standard input is empty
stdout
0