题目地址:
https://acs.jxnu.edu.cn/problem/NOIOPJENGLISH20
Messager Problem
信使问题
描述:
There are N nodes in the graph. Given the length of edges between the nodes, find the shortest path of size N and the nodes in the path are all different.
在图标里有N个节点。给出各个节点之间的边长。找出大小为 N的最短路径,并且路径中的节点都是不同的。
输入:
First line: one positive integer N (N <= 15).
Next N lines: the i-th line contains N non-negative integers (<= 1000) indicating the length of edges between the i-th node and other nodes.
第一行:一个正整数N(N <= 15)。
接下来的N行:第i行包括N个非负整数(<= 1000)表示第i个节点与其他节点的边长。
输出:
One line contains N integers, indicating the indexes of nodes in the shortest path.
一行包括N个整数,代表最短路径的结点的索引。
样例输入:
4 0 2 8 4 2 0 5 7 8 5 0 1 4 7 1 0
样例输出:
3 4 1 2