春招模拟赛|2022年9月21日华子秋招机试三道题
- Status
- Done
- Rule
- IOI
- Problem
- 3
- Start at
- 2023-4-10 19:00
- End at
- 2023-4-10 21:00
- Duration
- 2 hour(s)
- Host
- Partic.
- 186
No testdata at current.
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
给你一张完全图(任意两个点之间有边)。求解一条起点是0的路径使得其访问过所有点恰好一次并且最终要回到0点。n≤15
这是经典的TSP问题,可以用dfs求解,但是O(n!)的复杂度无法满分通过该题。可以使用状态压缩dp来优化这个过程。这类经典问题网上学习资料很多,可以自行学习。这里推荐一个:https://blog.csdn.net/LarsGyonX/article/details/122843238
本题属于以下题库,请选择所需题库进行购买