QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#411128#6749. Targetqiang9WA 0ms3840kbC++17740b2024-05-15 00:05:042024-05-15 00:05:06

Judging History

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

  • [2024-05-15 00:05:06]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3840kb
  • [2024-05-15 00:05:04]
  • 提交

answer

#include<bits/stdc++.h>
using ll=long long;
using PII=std::pair<int,int>;
#define int ll
const int N=3e5+10,mod=998244353;
const double eps=1e-4;
int n,k;
double a,b;
bool check(double s)
{
    if(std::fabs(s-b)>eps) return false;
    else return true;
}
void solve()
{
    std::cin>>a>>b;
    double s=0.5;
    ll cnt=0;
    while(std::fabs(a-b)>eps&&cnt<50)
    {
        if(check((a+1)*s))
        {
            std::cout<<2;
            break;
        }
        std::cout<<1;
        a*=s;
        cnt++;
    }
}
signed main()
{
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);

    int t=1;
    //std::cin>>t;
    while(t--)
    {
        solve();
    }
    return 0;
}




詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 3752kb

input:

0.5 0.25

output:

1

result:

ok ok

Test #2:

score: 0
Accepted
time: 0ms
memory: 3660kb

input:

1 0.75

output:

12

result:

ok ok

Test #3:

score: 0
Accepted
time: 0ms
memory: 3840kb

input:

1 0

output:

11111111111111

result:

ok ok

Test #4:

score: -100
Wrong Answer
time: 0ms
memory: 3764kb

input:

0.361954 0.578805

output:

11111111111111111111111111111111111111111111111111

result:

wrong answer wa