General
 
 
# Author Problem Lang Verdict Time Memory Sent Judged  
128192253 Practice:
vjudge3
263D - 19 C++17 (GCC 7-32) Accepted 154 ms 6328 KB 2021-09-08 12:56:33 2021-09-08 12:56:33
→ Source
#include<bits/stdc++.h>
using namespace std;
vector <int> a[100100];
int ti[100100];
int ma=0x3f3f3f;
int n,m,k,clk;
void dfs(int s)
{
	ti[s]=clk+1;
	int t=s;
	for(int i=0;i<a[s].size();i++)
	{
		int v=a[s][i];
		if(ti[v]<ti[t])t=v;
	}
	clk++;
	if(!ti[t]) dfs(t);
	else
	{
		printf("%d\n",clk-ti[t]+1);
		ma=ti[t];
	}
	if(ti[s]>=ma) printf("%d ",s);
}
int main()
{
	scanf("%d%d%d",&n,&m,&k);
	for(int i=1;i<=m;i++)
	{
		int x,y;
		scanf("%d%d",&x,&y);
		a[x].push_back(y);
		a[y].push_back(x);
	}
	dfs(1);
}
  	        			  		 	 	   				
?
Time: ? ms, memory: ? KB
Verdict: ?
Input
?
Participant's output
?
Jury's answer
?
Checker comment
?
Diagnostics
?
Click to see test details