| 129 | } |
| 130 | |
| 131 | public static void main(String[] args) throws Exception { |
| 132 | FastReader in = new FastReader(System.in); |
| 133 | PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out)); |
| 134 | cntg = 1; |
| 135 | n = in.nextInt(); |
| 136 | m = in.nextInt(); |
| 137 | for (int i = 1, u, v; i <= m; i++) { |
| 138 | u = in.nextInt(); |
| 139 | v = in.nextInt(); |
| 140 | addEdge(u, v); |
| 141 | addEdge(v, u); |
| 142 | } |
| 143 | for (int i = 1; i <= n; i++) { |
| 144 | if (dfn[i] == 0) { |
| 145 | // tarjan1(i, 0); |
| 146 | tarjan2(i, 0); |
| 147 | } |
| 148 | } |
| 149 | int ansCnt = 0; |
| 150 | for (int i = 1; i <= m; i++) { |
| 151 | if (cutEdge[i]) { |
| 152 | ansCnt++; |
| 153 | } |
| 154 | } |
| 155 | out.println(ansCnt); |
| 156 | for (int i = 1; i <= m; i++) { |
| 157 | if (cutEdge[i]) { |
| 158 | out.print(i + " "); |
| 159 | } |
| 160 | } |
| 161 | out.println(); |
| 162 | out.flush(); |
| 163 | out.close(); |
| 164 | } |
| 165 | |
| 166 | // 读写工具类 |
| 167 | static class FastReader { |