백준
[1057] 토너먼트
Jcoder
2018. 8. 13. 20:16
#include<iostream>using namespace std;int main(){int total, kim, im, count = 0;cin >> total >> kim >> im;if (total < kim || total < im){count = -1;}else{while (kim != im){kim = (kim + 1) / 2;im = (im + 1) / 2;count++;}}cout << count << endl;return 0;}