QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#384611 | #6749. Target | huo_hua_ya | TL | 0ms | 3896kb | C++14 | 367b | 2024-04-10 03:59:48 | 2024-04-10 03:59:48 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
double equ=1e-4;
int main(){
double a,b;cin>>a>>b;
vector<int> ans;
while(fabs(b-a)>equ){
if(b<a){
a=a/2;
ans.push_back(1);
}
else{
a=a/2+0.5;
ans.push_back(2);
}
}
for(auto t:ans)cout<<t;
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3640kb
input:
0.5 0.25
output:
1
result:
ok ok
Test #2:
score: 0
Accepted
time: 0ms
memory: 3896kb
input:
1 0.75
output:
12
result:
ok ok
Test #3:
score: 0
Accepted
time: 0ms
memory: 3796kb
input:
1 0
output:
11111111111111
result:
ok ok
Test #4:
score: -100
Time Limit Exceeded
input:
0.361954 0.578805