QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#594228 | #6749. Target | LianYan | WA | 0ms | 3872kb | C++20 | 1.2kb | 2024-09-27 20:27:59 | 2024-09-27 20:28:00 |
Judging History
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