Language: C++

#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cstring>

using namespace std;

int n,m;

vector<int> sus[100050];
bool bio[100050];
vector<int>posjet;
vector<int>sol;

void input(){
	cin>>n>>m;
	int br1,br2;
	for(int i=0;i<m;i++){
		cin>>br1>>br2;
		sus[br1].push_back(br2);
		sus[br2].push_back(br1);
	}
}

bool func(int cv){
	for(int i=0;i<sus[cv].size();i++){
		if(!bio[sus[cv][i]]){
			return false;
			break;
		}
	}
	return true;
}

void dfs(int node){
	if(sol.size()>0)return;
	bio[node]=true;
	posjet.push_back(node);
	for(int i=0;i<sus[node].size();i++){
		int x=sus[node][i];
		if(bio[x])continue;
		dfs(x);
	}
	
	int prv=posjet[0];
	int dr=posjet[1];
	bool ok=true;
	
	ok=func(prv);
	if(ok)ok=func(dr);
	
	if(ok && sol.empty()){
		for(int i=0;i<posjet.size();i++){
			sol.push_back(posjet[i]);
		}
	}
	else{
		bio[node]=false;
		posjet.pop_back();
	}
}

void solve(){
	int min_sus=9999999;
	for(int i=1;i<=n;i++){
		int br=sus[i].size();
		min_sus=min(min_sus,br);
	}
	for(int i=1;i<=n;i++){
		if(sus[i].size()==min_sus){
			memset(bio,0,sizeof(bio));
			dfs(i);
		}
	}
	cout<<sol.size()<<"\n";
	for(int i=0;i<sol.size();i++)cout<<sol[i]<<" ";
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	
	input();
	solve();
	
	
	
	
	return 0;
}#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cstring>

using namespace std;

int n,m;

vector<int> sus[100050];
bool bio[100050];
vector<int>posjet;
vector<int>sol;

void input(){
	cin>>n>>m;
	int br1,br2;
	for(int i=0;i<m;i++){
		cin>>br1>>br2;
		sus[br1].push_back(br2);
		sus[br2].push_back(br1);
	}
}

bool func(int cv){
	for(int i=0;i<sus[cv].size();i++){
		if(!bio[sus[cv][i]]){
			return false;
			break;
		}
	}
	return true;
}

void dfs(int node){
	if(sol.size()>0)return;
	bio[node]=true;
	posjet.push_back(node);
	for(int i=0;i<sus[node].size();i++){
		int x=sus[node][i];
		if(bio[x])continue;
		dfs(x);
	}
	
	int prv=posjet[0];
	int dr=posjet[1];
	bool ok=true;
	
	ok=func(prv);
	if(ok)ok=func(dr);
	
	if(ok && sol.empty()){
		for(int i=0;i<posjet.size();i++){
			sol.push_back(posjet[i]);
		}
	}
	else{
		bio[node]=false;
		posjet.pop_back();
	}
}

void solve(){
	int min_sus=9999999;
	for(int i=1;i<=n;i++){
		int br=sus[i].size();
		min_sus=min(min_sus,br);
	}
	for(int i=1;i<=n;i++){
		if(sus[i].size()==min_sus){
			memset(bio,0,sizeof(bio));
			dfs(i);
		}
	}
	cout<<sol.size()<<"\n";
	for(int i=0;i<sol.size();i++)cout<<sol[i]<<" ";
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	
	input();
	solve();
	
	
	
	
	return 0;
}

Compiler output:
a.cc:91:2: error: stray '#' in program
   91 | }#include<iostream>
      |  ^
a.cc:91:3: error: 'include' does not name a type
   91 | }#include<iostream>
      |   ^~~~~~~
a.cc:99:5: error: redefinition of 'int n'
   99 | int n,m;
      |     ^
a.cc:9:5: note: 'int n' previously declared here
    9 | int n,m;
      |     ^
a.cc:99:7: error: redefinition of 'int m'
   99 | int n,m;
      |       ^
a.cc:9:7: note: 'int m' previously declared here
    9 | int n,m;
      |       ^
a.cc:101:13: error: redefinition of 'std::vector<int> sus [100050]'
  101 | vector<int> sus[100050];
      |             ^~~
a.cc:11:13: note: 'std::vector<int> sus [100050]' previously declared here
   11 | vector<int> sus[100050];
      |             ^~~
a.cc:102:6: error: redefinition of 'bool bio [100050]'
  102 | bool bio[100050];
      |      ^~~
a.cc:12:6: note: 'bool bio [100050]' previously declared here
   12 | bool bio[100050];
      |      ^~~
a.cc:103:12: error: redefinition of 'std::vector<int> posjet'
  103 | vector<int>posjet;
      |            ^~~~~~
a.cc:13:12: note: 'std::vector<int> posjet' previously declared here
   13 | vector<int>posjet;
      |            ^~~~~~
a.cc:104:12: error: redefinition of 'std::vector<int> sol'
  104 | vector<int>sol;
      |            ^~~
a.cc:14:12: note: 'std::vector<int> sol' previously declared here
   14 | vector<int>sol;
      |            ^~~
a.cc:106:6: error: redefinition of 'void input()'
  106 | void input(){
      |      ^~~~~
a.cc:16:6: note: 'void input()' previously defined here
   16 | void input(){
      |      ^~~~~
a.cc:116:6: error: redefinition of 'bool func(int)'
  116 | bool func(int cv){
      |      ^~~~
a.cc:26:6: note: 'bool func(int)' previously defined here
   26 | bool func(int cv){
      |      ^~~~
a.cc:126:6: error: redefinition of 'void dfs(int)'
  126 | void dfs(int node){
      |      ^~~
a.cc:36:6: note: 'void dfs(int)' previously defined here
   36 | void dfs(int node){
      |      ^~~
a.cc:154:6: error: redefinition of 'void solve()'
  154 | void solve(){
      |      ^~~~~
a.cc:64:6: note: 'void solve()' previously defined here
   64 | void solve(){
      |      ^~~~~
a.cc:170:5: error: redefinition of 'int main()'
  170 | int main(){
      |     ^~~~
a.cc:80:5: note: 'int main()' previously defined here
   80 | int main(){
      |     ^~~~