QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#411114#6749. TargetYmkWA 0ms3652kbC++23748b2024-05-14 23:09:422024-05-14 23:09:43

Judging History

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

  • [2024-05-14 23:09:43]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3652kb
  • [2024-05-14 23:09:42]
  • 提交

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