QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#410371 | #6749. Target | yi_y# | TL | 0ms | 3664kb | C++11 | 272b | 2024-05-13 22:26:44 | 2024-05-13 22:26:46 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define eps (1e-4)-(1e-6)
int main()
{
double a,b;
cin>>a>>b;
string s;
double del=eps;
while(fabs(a-b)>del)
{
if(b<0.5)b*=2,s="1"+s;
else b=b*2-1,s="2"+s;
//del*=2;
}
cout<<s<<'\n';
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3664kb
input:
0.5 0.25
output:
1
result:
ok ok
Test #2:
score: -100
Time Limit Exceeded
input:
1 0.75