Floyd一定爆空间是吧

P1342 请柬

48WangYanJi @ 2024-10-08 11:55:18

rt


by 幻想繁星 @ 2024-10-08 11:57:43

@48WangYanJi 这题怎么看也不能 Floyd 吧


by lichenxi108 @ 2024-10-08 12:00:44

Floyd 时间复杂度 0(n^3),空间复杂度 O(n^3) ,不行吧


by wwwidk1234 @ 2024-10-08 12:29:54

@lichenxi108 Floyd 空间复杂度不是 O(n^2) 吗?开一个 dp[N][N] 就够了


by lichenxi108 @ 2024-10-08 12:54:43

@wwwidk1234 刚才打错了


|