QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#526037 | #6749. Target | lwl2005 | TL | 0ms | 3980kb | C++14 | 362b | 2024-08-21 10:03:22 | 2024-08-21 10:03:22 |
Judging History
answer
#include <iostream>
using namespace std;
double a,b;
char s;
int main()
{
cin>>a>>b;
while(abs(a-b)>0.0001)
{
if(abs(a*0.5-b)<=abs((a-1)*0.5+1-b))
{
a=a*0.5;
printf("1");
}
else
{
a=(a-1)*0.5+1;
printf("2");
}
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3852kb
input:
0.5 0.25
output:
1
result:
ok ok
Test #2:
score: 0
Accepted
time: 0ms
memory: 3796kb
input:
1 0.75
output:
12
result:
ok ok
Test #3:
score: 0
Accepted
time: 0ms
memory: 3980kb
input:
1 0
output:
11111111111111
result:
ok ok
Test #4:
score: -100
Time Limit Exceeded
input:
0.361954 0.578805
output:
212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121...