QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#383917 | #6749. Target | Teiosama# | WA | 1ms | 3852kb | C++17 | 394b | 2024-04-09 18:49:45 | 2024-04-09 18:49:45 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
int main()
{
double a,b;cin>>a>>b;
if(a==b)
{
cout<<"1";
return 0;
}
while(fabs(a-b)>0.0001)
{
double w1=2*b;
double w2=2*b-1;
if(b==0)
{
a/=2;
cout<<"1";
}
else if(b==1)
{
a=a/2+0.5;cout<<"2";
}
else if(w1>=0&&w1<=1)
{
b*=2;
cout<<"2";
}
else{
b=2*b-1;
cout<<"1";
}
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3852kb
input:
0.5 0.25
output:
2
result:
wrong answer wa