紊莫 @ 2022-12-04 11:06:01
算法的正确性没有问题,但是可能我人傻常数大,求助大佬应该怎么修改??
code
by dxy2020 @ 2022-12-04 11:31:35
把块内排序改成归并试试?
by Albert_Wei @ 2022-12-04 11:41:59
@Velvet 时间复杂度是
by 紊莫 @ 2022-12-04 11:55:06
@Unbeliveble 不是
by 紊莫 @ 2022-12-04 11:56:14
是
by 紊莫 @ 2022-12-04 12:00:56
艹破案了,在:
for(int i=1;i<=sq;++i){
for(int j=st[i];j<=ed[i];j++){
v[i].push_back(a[j]);
}
sort(v[i].begin(),v[i].end());
}
没加bl[j]=i;
但是还是很疑惑,这么离谱却没导致WA而是复杂度退化??
by 紊莫 @ 2022-12-04 12:01:47
懂了,此贴结
by Albert_Wei @ 2022-12-04 12:02:54
@Velvet 额那没事了