QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#623033 | #5721. Dividing by Two | Rebuked | WA | 0ms | 3624kb | C++14 | 327b | 2024-10-09 09:42:14 | 2024-10-09 09:42:15 |
Judging History
answer
#include <iostream>
using namespace std;
int main() {
int a;
int b;
cin >> a >> b;
if(a == b) {
cout << "0";
} else if(b > a) {
cout << b-a;
} else {
if(a%b != 0) {
int count = 0;
while(a != b) {
++a;
a/=2;
if(a == b) {
++count;
break;
} else if(a<b) {
count += b-a;
break;
}
}
cout << count;
}
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3624kb
input:
103 27
output:
1
result:
wrong answer 1st lines differ - expected: '4', found: '1'