QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#408990#6749. Targettutuwizard#WA 1ms3900kbC++20364b2024-05-11 14:28:202024-05-11 14:28:21

Judging History

This is the latest submission verdict.

  • [2024-05-11 14:28:21]
  • Judged
  • Verdict: WA
  • Time: 1ms
  • Memory: 3900kb
  • [2024-05-11 14:28:20]
  • Submitted

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