bsdsdb @ 2023-05-13 15:19:40
二分插入,然后知道中位数是啥就做完了
by bsdsdb @ 2023-05-13 15:20:15
(这算讨论区题解吗
by jijidawang @ 2023-05-13 15:26:34
这个插入要写平衡树复杂度才对吧
by A1438329629 @ 2023-05-13 15:29:23
能用这些东西做出来就行了
by hy233 @ 2023-05-13 15:45:30
@FeiWuLiuZiao 问题是你要怎么插入呢
by HyB_Capricornus @ 2023-05-13 18:12:16
题解里的第一篇,vector 插入是 O(n),所以复杂度是 O(N),100% 可以过么?数据太水了吧。
by HyB_Capricornus @ 2023-05-13 18:13:11
写错了,复杂度是 O(N^2)
by bsdsdb @ 2023-05-13 18:54:52
@hy233 二分不就行了
by bsdsdb @ 2023-05-13 18:55:38
@A1438329629 看P1001的题解,再看看P1001的算法标签
by bsdsdb @ 2023-05-14 07:57:31
@HyB_Capricornus 插入用二分,复杂度是
by HyB_Capricornus @ 2023-05-14 08:29:09
@FeiWuLiuZiao 查询是 O(log n) 的,但vector插入是一个一个往右挪的,应该是 O(n) 吧