QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#412839 | #6749. Target | incloud# | TL | 1ms | 3916kb | C++14 | 508b | 2024-05-16 20:13:47 | 2024-05-16 20:13:47 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
double a,b;
cin>>a>>b;
stack<int> ans;
double tb=b+6.10352e-05;
while(abs(a-tb)>0.0001){
tb*=2;
if(abs(a-tb)<=0.0001){
ans.push(1);
break;
}
if(tb>1){
tb-=1;
ans.push(2);
}
else ans.push(1);
}
while(ans.size()){
cout<<ans.top();
ans.pop();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3916kb
input:
0.5 0.25
output:
1111111111121
result:
ok ok
Test #2:
score: 0
Accepted
time: 1ms
memory: 3688kb
input:
1 0.75
output:
11111111111122
result:
ok ok
Test #3:
score: 0
Accepted
time: 0ms
memory: 3844kb
input:
1 0
output:
11111111111111
result:
ok ok
Test #4:
score: -100
Time Limit Exceeded
input:
0.361954 0.578805