QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#412852#6749. Targetincloud#WA 0ms3868kbC++14467b2024-05-16 20:22:012024-05-16 20:22:01

Judging History

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

  • [2024-05-16 20:22:01]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3868kb
  • [2024-05-16 20:22:01]
  • 提交

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