QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#623033#5721. Dividing by TwoRebukedWA 0ms3624kbC++14327b2024-10-09 09:42:142024-10-09 09:42:15

Judging History

你现在查看的是最新测评结果

  • [2024-10-09 09:42:15]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3624kb
  • [2024-10-09 09:42:14]
  • 提交

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'