可以用c++库自带函数count_if;
#include<bits/stdc++.h>
using namespace std;
vector<int> graph[505];
bool visited[505];
int N,M;
void DFS(int v){
visited[v]= true;
for(int it:graph[v]){
if (!visited[it])
DFS(it);
}
}
int main(){
cin>>N>>M;
while (M--){
int a,b;
cin>>a>>b;
graph[a].push_back(b);
graph[b].push_back(a);
}
for (int i = 1; i < N+1; ++i) {
printf("%s%d",i>1?" ":"",graph[i].size());
}
printf("\n");
DFS(1);
if (find(visited+1,visited+N+1,false)-visited==N+1) {
int num = count_if(graph + 1, graph + N + 1, [](vector<int> &a) {
return a.size() % 2 == 1;
});
if (num == 0)
printf("Eulerian");
else if (num == 2)
printf("Semi-Eulerian");
else
printf("Non-Eulerian");
} else
printf("Non-Eulerian");
return 0;
}