#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 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 .","subType":"markdown"},{"sectionTitle":"Input Format","type":"Text","text":"The first line contains two positive integers and , representing the number of nodes and edges, respectively. \r\nThe next lines each contain three positive integers , , and , indicating that there is an edge of length between nodes and .","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"]}]}