P7771 [Template] Euler Path

Description

Find the lexicographically smallest Euler path in a directed graph.

Input Format

The first line contains two integers $n, m$, representing the number of vertices and edges in the directed graph. The next $m$ lines each contain two integers $u, v$, indicating that there is a directed edge $u \to v$.

Output Format

If an Euler path does not exist, output one line `No`. Otherwise, output one line with $m + 1$ numbers, representing the lexicographically smallest Euler path.

Explanation/Hint

For $50\%$ of the testdata, $n, m \leq 10^3$. For $100\%$ of the testdata, $1 \leq u, v \leq n \leq 10^5$, and $m \leq 2 \times 10^5$. It is guaranteed that if each directed edge is treated as an undirected edge, the graph is connected. The testdata generator for this problem: ```cpp #include #include using namespace std; typedef unsigned long long ull; #define N 100005 #define For(i,x,y)for(i=x;i