QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#692122 | #6749. Target | xuedinedtouzi# | RE | 0ms | 0kb | C++23 | 493b | 2024-10-31 13:51:40 | 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