QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#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;
}
详细
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