QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#411114 | #6749. Target | Ymk | WA | 0ms | 3652kb | C++23 | 748b | 2024-05-14 23:09:42 | 2024-05-14 23:09:43 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pair pair<int,int>
#define endl '\n'
#define N (int)2e5+7
#define INF 0x3f3f3f3f//����� INT_MAX ����С INT_MIN
void solve()
{
double a,b,c=0;
cin>>a>>b;
double x[54],v=0.5;
bool bo[54]={0};
for(int i=50;i>0;i--)
{
if(c+v<=b)
{
c+=v;
bo[i]=1;
}
v*=0.5;
if(fabs(c-b)<=1e1-4) break;
}
for(int i=1;i<=50;i++)
{
if(bo[i]) cout<<2;
else cout<<1;
}
}
int main()
{
std::ios::sync_with_stdio(false);
cin.tie(0),cout.tie(0);
int t=1;
// cin>>t;
while(t--)
solve();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3652kb
input:
0.5 0.25
output:
11111111111111111111111111111111111111111111111111
result:
wrong answer wa