QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#692122#6749. Targetxuedinedtouzi#RE 0ms0kbC++23493b2024-10-31 13:51:402024-10-31 13:51:40

Judging History

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

  • [2024-10-31 13:51:40]
  • 评测
  • 测评结果:RE
  • 用时:0ms
  • 内存:0kb
  • [2024-10-31 13:51:40]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

set <int> st;
double x,y;
int a,b;
int cao[55],idx=0;
bool dfs(int x)
{
	if(st.count(x))return 0;
	if(x==b)return 1;
	st.insert(x);
	bool flag=0;
	flag=dfs(x/2+5000);
	if(flag)
	{
		cao[idx]=2;
		idx++;
		return 1;
	}
	flag=dfs(x/2);
	if(flag)
	{
		cao[idx]=1;
		idx++;
		return 1;
	}
	return 0;
}
int main()
{
	cin>>x>>y;
	a=x*10000;
	b=y*10000;
	dfs(a);
	for(int i=idx-1;i>=0;--i)
	{
		cout<<cao[i];
	}
} 

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Runtime Error

input:

0.5 0.25

output:


result: