QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#406713#6749. Targetqiang9WA 1ms3792kbC++17855b2024-05-07 16:59:542024-05-07 16:59:55

Judging History

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

  • [2024-05-07 16:59:55]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3792kb
  • [2024-05-07 16:59:54]
  • 提交

answer

#include<bits/stdc++.h>
using ll=long long;
//#define int ll
const int N=2e5+10;
const int mod=998244353;
const double eps=1e-4;

void solve()
{
    double a,b;
    std::cin>>a>>b;
    if(a<b) std::swap(a,b);
    int op=0;
    while(op<=50)
    {
        if(std::fabs(a-b)<=eps)
        {
            //std::cout<<op<<'\n';
            break;
        }
        if(std::fabs(a/2.0-b)-std::fabs((a+1)/2.0-b)>=1e-18){
            a=(a+1)/2.0;
            std::cout<<2;
        }else{
            a=a/2.0;
            std::cout<<1;
        }
        //std::cout<<1e-4<<'\n';
        op++;

    }
    //printf("%.10f %.10f",a,b);
}
signed main()
{
//    std::ios::sync_with_stdio(false);
//    std::cin.tie(nullptr);
    int t=1;
    //std::cin>>t;
    while(t--)
    {
        solve();
    }
    return 0;
}
//GJAH

詳細信息

Test #1:

score: 100
Accepted
time: 1ms
memory: 3732kb

input:

0.5 0.25

output:

1

result:

ok ok

Test #2:

score: 0
Accepted
time: 1ms
memory: 3792kb

input:

1 0.75

output:

12

result:

ok ok

Test #3:

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

input:

1 0

output:

11111111111111

result:

ok ok

Test #4:

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

input:

0.361954 0.578805

output:

112112112112112112112112112112112112112112112112112

result:

wrong answer wa