https://acs.jxnu.edu.cn/problem/NOIOPJENGLISH20
1000ms 65536K
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行:第i行包含n个非负整数表示第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