QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#594238#6749. TargetLianYanWA 0ms3872kbC++201.2kb2024-09-27 20:32:062024-09-27 20:32:06

Judging History

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

  • [2024-09-27 20:32:06]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3872kb
  • [2024-09-27 20:32:06]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define up(i, a, b) for (int i = (a); i <= (b); i++)
#define dn(i, a, b) for (int i = (a); i >= (b); i--)
typedef long long ll;
inline int read()
{
    int x = 0, f = 1;
    char ch = getchar();
    while (ch < 48 || ch > 57)
    {
        if (ch == '-')
            f = -1;
        ch = getchar();
    }
    while (ch >= 48 && ch <= 57)
    {
        x = (x << 1) + (x << 3) + (ch ^ 48);
        ch = getchar();
    }
    return x * f;
}
inline void write(int x)
{
    if (x < 0)
    {
        putchar('-');
        x = -x;
    }
    if (x > 9)
        write(x / 10);
    putchar(x % 10 + '0');
}

void solve()
{
    double a, b;
    cin >> a >> b;
    if (b == 1)
        b = 0.999999999;
    string s;
    up(i, 1, 50)
    {
        b *= 2;
        if (b >= 1)
        {
            s = "1" + s;
            b -= 1;
        }
        else
            s = "0" + s;
    }
    for (auto i : s)
    {
        if (s[i] - '0')
            cout << 1;
        else
            cout << 2;
    }
}

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    solve();

    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

0.5 0.25

output:

11111111111111111111111111111111111111111111111121

result:

ok ok

Test #2:

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

input:

1 0.75

output:

11111111111111111111111111111111111111111111111111

result:

wrong answer wa