QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#384611#6749. Targethuo_hua_yaTL 0ms3896kbC++14367b2024-04-10 03:59:482024-04-10 03:59:48

Judging History

你现在查看的是最新测评结果

  • [2024-04-10 03:59:48]
  • 评测
  • 测评结果:TL
  • 用时:0ms
  • 内存:3896kb
  • [2024-04-10 03:59:48]
  • 提交

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

output:


result: