QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#594228#6749. TargetLianYanWA 0ms3872kbC++201.2kb2024-09-27 20:27:592024-09-27 20:28:00

Judging History

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

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

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;
    }
    up(i, 1, 50)
    {
        if (s[i] - '0')
            cout << 2;
        else
            cout << 1;
    }
}

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

    solve();

    return 0;
}

详细

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3872kb

input:

0.5 0.25

output:

11111111111111111111111111111111111111111111111212

result:

wrong answer wa