#Q74. 「一本通 3.2 例 1」Sightseeing Trip

「一本通 3.2 例 1」Sightseeing Trip

[{"sectionTitle":"Problem Description","type":"Text","text":"Original source: CEOI 1999\r\n\r\nGiven an undirected graph, find a cycle that contains at least 33 nodes, where the nodes on the cycle are not repeated, and the sum of the lengths of the edges on the cycle is minimized. This problem is known as the minimum cycle problem in undirected graphs. In this problem, you need to output the solution for the minimum cycle. If there are multiple minimum cycles, you may output any one of them. If no solution exists, output No solution. \r\nThe number of nodes in the graph does not exceed 100100.","subType":"markdown"},{"sectionTitle":"Input Format","type":"Text","text":"The first line contains two positive integers nn and mm, representing the number of nodes and edges, respectively. \r\nThe next mm lines each contain three positive integers xx, yy, and zz, indicating that there is an edge of length zz between nodes xx and yy.","subType":"markdown"},{"sectionTitle":"Output Format","type":"Text","text":"Output the solution for the minimum cycle: print the nodes on the cycle in order. If there are multiple minimum cycles, you may output any one of them. If no solution exists, output No solution.","subType":"markdown"},{"sectionTitle":"Sample","type":"Sample","text":"","subType":"markdown","payload":["5 7\n1 4 1\n1 3 300\n3 1 10\n1 2 16\n2 3 100\n2 5 15\n5 3 20","1 3 5 2"]}]}