QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#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;
}
}
}
详细
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'