#include
#include
#include
#include
# include
using namespace std;
int n,m;
Bool visited [100010].
Struct edge
{
Int the to order;
};
Vector
Bool big (edge & amp; E1, edge & amp; E2)
{
Return e1. To
Int num=0;
Stack
Void the show ()
{
Int ary [10010].
Int TMP=0;
while(! Sta. The empty ())
{
Ary [tmp++]=sta. The top ();
The sta. Pop ();
}
For (int I=TMP - 1; I>=0; I -)
{
Cout
}
Bool b=false;
Void DFS (int n)
{
for (int i=0; i
if (! Visited [allnode [n] [I] order])
{
Visited [allnode [n] [I] order]=true;
num++;
Sta. Push (allnode [n] [I] to);
If (num==m)
{
B=true;
Show ();
}
DFS (allnode [n] [I] to);
If (b)
{
return ;
}
if (! Sta. The empty ())
{
The sta. Pop ();
}
Num -;
Visited [allnode [n] [I] order]=false;
}
}
}
Int main ()
{
Memset (visited, 0, sizeof (visited));
Cin> N> m;
Int a, s,
Allnode. Resize (n + 1);
for (int i=0; i
Cin> A> s;
Edge tmpe;
Tmpe. To=s;
Tmpe. Order=I;
Allnode [a]. Push_back (tmpe);
Tmpe. To=a;
Allnode [s]. Push_back (tmpe);
}
for (int i=0; i
Sort (allnode [I] the begin (), allnode [I] the end (), big);
}
The sta. Push (1);
DFS (1);
if (! B)
{
Cout<- 1;
}
return 0;
}
CodePudding user response:
Code, is a little long,,CodePudding user response:
Figure it out, the sort used in the function cannot reference, complains