QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#383447 | #6749. Target | youxiao# | WA | 0ms | 3868kb | C++20 | 771b | 2024-04-09 14:15:09 | 2024-04-09 14:15:09 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define ll long long
const int N=11000;
const double eps=1e-5;
#define endl '\n'
int check(double x){
if(fabs(x)<eps)return 0;
if(x>0)return 1;
return -1;
}
int main(){
#ifdef LOCAL
freopen("input.in","r",stdin);
freopen("output.out","w",stdout);
#endif
ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
double a,b;
cin>>a>>b;
int st=50;
while(st--){
int f=check(a-b);
// cerr<<a<<" "<<b<<endl;
if(f==0){
break;
}
if(f==1){
a/=2.0;
cout<<1;
}
if(f==-1){
a=(a+1.0)/2.0;
cout<<2;
}
}
cout<<endl;
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3680kb
input:
0.5 0.25
output:
1
result:
ok ok
Test #2:
score: 0
Accepted
time: 0ms
memory: 3800kb
input:
1 0.75
output:
12
result:
ok ok
Test #3:
score: 0
Accepted
time: 0ms
memory: 3800kb
input:
1 0
output:
11111111111111111
result:
ok ok
Test #4:
score: -100
Wrong Answer
time: 0ms
memory: 3868kb
input:
0.361954 0.578805
output:
21212121212121212121212121212121212121212121212121
result:
wrong answer wa