Current work
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
3 6
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
#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;
|
||||
}
|
||||
Reference in New Issue
Block a user