QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#409635#6749. Targetasoulcoming#WA 1ms3664kbC++20552b2024-05-12 13:46:032024-05-12 13:46:04

Judging History

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

  • [2024-05-12 13:46:04]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3664kb
  • [2024-05-12 13:46:03]
  • 提交

answer

#include<bits/stdc++.h>
#define int long long
#define lowbit(x) x&(-x)
#define endl '\n'

using namespace std;

const int N=2e5+10;
const int mod=998244353;
const double eps=1e-6;
typedef pair<int,int>PII;

void solve()
{
	double a,b;
	cin>>a>>b;
	string s;
	while(fabs(a-b)>eps)
	{
		if(a>b)a=a*0.5,s+='1';
		else a=(a-1)*0.5+1.0,s+='2';
		if(s.size()>49)break;
	}
	cout<<s<<endl;
}
signed main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int t=1;
//	cin>>t;
	while(t--)solve();
	return 0;
}




Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

0.5 0.25

output:

1

result:

ok ok

Test #2:

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

input:

1 0.75

output:

12

result:

ok ok

Test #3:

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

input:

1 0

output:

11111111111111111111

result:

ok ok

Test #4:

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

input:

0.361954 0.578805

output:

21212121212121212121212121212121212121212121212121

result:

wrong answer wa