QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#387431 | #6749. Target | k1nsom | WA | 0ms | 3800kb | C++17 | 837b | 2024-04-12 15:00:37 | 2024-04-12 15:00:38 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define N 200005
#define double long double
#define endl '\n'
double a, b, x;
int ans[N] = {0};
signed main()
{
cin >> a >> b;
/*
操作一:a=a*0.5;等价于b=b*2;
操作二:a=a+0.5;等价于b=b-0.5
*/
for (int i = 1; i <= 25; i++)
cout << 1; // a置'零'
for (int i = 1; i <= 25; i++)
{
if (b - 0.5 > 1e-4)
{
b -= 0.5;
ans[i] = 2;
}
else
{
b *= 2;
ans[i] = 1;
}
}
x = 0;
for (int i = 25; i >= 1; i--)
{
if (ans[i] == 1)
x = x * 0.5;
else
x = x + 0.5;
cout << ans[i];
}
// cout << endl
// << x;
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3800kb
input:
0.5 0.25
output:
11111111111111111111111112121212121212121212121211
result:
wrong answer wa