QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#412852 | #6749. Target | incloud# | WA | 0ms | 3868kb | C++14 | 467b | 2024-05-16 20:22:01 | 2024-05-16 20:22:01 |
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;
int cnt=0;
while(cnt<=50&&abs(a-tb)>0.0001){
cnt++;
tb*=2;
if(tb-0.0001>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: 3564kb
input:
0.5 0.25
output:
1111111111121
result:
ok ok
Test #2:
score: 0
Accepted
time: 0ms
memory: 3740kb
input:
1 0.75
output:
11111111111122
result:
ok ok
Test #3:
score: 0
Accepted
time: 0ms
memory: 3868kb
input:
1 0
output:
11111111111111
result:
ok ok
Test #4:
score: -100
Wrong Answer
time: 0ms
memory: 3616kb
input:
0.361954 0.578805
output:
122212222221211222221111112111121121111221111212112
result:
wrong answer wa