Files
usaco/solving/the-lost-cow/main.cpp
T
2026-08-03 19:03:58 +01:00

28 lines
466 B
C++

#include "../../debugging.h"
#include <cstdio>
#include <iostream>
using namespace std;
int main() {
freopen("lostcow.in", "r", stdin);
freopen("lostcow.out", "w", stdout);
/**
John has lost his cow
Bessie is at some location on a number line
John at x, Bessie at y
**/
int x, y;
cin >> x >> y;
int powTwo = 1, res = 0;
while (!((x + powTwo <= y && y <= x) || (x <= y && y <= x + powTwo))) {
powTwo *= -2;
}
cout << res;
}