QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#411128 | #6749. Target | qiang9 | WA | 0ms | 3840kb | C++17 | 740b | 2024-05-15 00:05:04 | 2024-05-15 00:05:06 |
Judging History
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