QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#404747#6749. Targetqzuser#WA 1ms3764kbC++17345b2024-05-04 16:42:382024-05-04 16:42:40

Judging History

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

  • [2024-05-04 16:42:40]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3764kb
  • [2024-05-04 16:42:38]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
int main()
{
    double a, b;
    cin >> a >> b;
    for (int i = 1; i <= 50; i ++)
    {
        if (abs(b - a) < 1e-4) break;
        double x = a / 2, y = (a + 1.0) / 2;
        if (abs(b - x) <= abs (b - y)) cout << "1", a = x;
        else cout << "2", a = y;
    }
    return 0;
}

详细

Test #1:

score: 100
Accepted
time: 1ms
memory: 3708kb

input:

0.5 0.25

output:

1

result:

ok ok

Test #2:

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

input:

1 0.75

output:

12

result:

ok ok

Test #3:

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

input:

1 0

output:

11111111111111

result:

ok ok

Test #4:

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

input:

0.361954 0.578805

output:

21212121212121212121212121212121212121212121212121

result:

wrong answer wa