QOJ.ac
QOJ
The 2nd Universal Cup Finals is coming! Check out our event page, schedule, and competition rules!
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#408990 | #6749. Target | tutuwizard# | WA | 1ms | 3900kb | C++20 | 364b | 2024-05-11 14:28:20 | 2024-05-11 14:28:21 |
Judging History
answer
#include <bits/stdc++.h>
#define int long long
using namespace std;
const double eps=1e-4;
signed main(){
double a,b;
cin >>a>>b;
string s;
if(b==1.0) b=0.999999999;
for(int i=1;i<=50;i++)
{
if(b*2>=1.0) s+='1',b-=1.0;
else s+='0';
b*=2.0;
}
for(int i=49;i>=0;i--)
{
if(s[i]=='0')
cout<<1;
else cout<<2;
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3900kb
input:
0.5 0.25
output:
11111111111111111111111111111111111111111111111121
result:
ok ok
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 3848kb
input:
1 0.75
output:
11111111111111111111111111111111111111111111111112
result:
wrong answer wa