QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#594168#6749. TargetBulonteWA 0ms3912kbC++20485b2024-09-27 19:54:292024-09-27 19:54:30

Judging History

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

  • [2024-09-27 19:54:30]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3912kb
  • [2024-09-27 19:54:29]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

int main()
{
    long double a, b;
    scanf("%llf %llf", &a, &b);
    double tmp = 1e-4;
    for (int i = 1; i <= 50; i++)
    {
        if (a > b)
        {
            cout << 1;
            a /= 2;
        }
        else
        {
            cout << 2;
            a = 0.5 * (a + 1);
        }
        tmp /= 2;
        if (fabs(a - b) <= tmp)
        {
            break;
        }
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3772kb

input:

0.5 0.25

output:

1

result:

ok ok

Test #2:

score: 0
Accepted
time: 0ms
memory: 3876kb

input:

1 0.75

output:

12

result:

ok ok

Test #3:

score: 0
Accepted
time: 0ms
memory: 3792kb

input:

1 0

output:

11111111111111111111111111111111111111111111111111

result:

ok ok

Test #4:

score: -100
Wrong Answer
time: 0ms
memory: 3912kb

input:

0.361954 0.578805

output:

21212121212121212121212121212121212121212121212121

result:

wrong answer wa