站外题求思路 玄1关

灌水区

@[a_little_carrot](/user/1042960) 二分最远距离然后check?
by Rem_CandleFire @ 2024-04-22 07:33:59


@[a_little_carrot](/user/1042960) 不是没人看,是我们都不会QWQ
by DFs_YYDS @ 2024-04-22 07:38:15


@[Rem_CandleFire](/user/421421) 以我对二分拙劣的理解,check肯定写不出(悲
by a_little_carrot @ 2024-04-22 08:07:31


@[Rem_CandleFire](/user/421421) 有没有实现方法 ~~我自己写肯定时间复杂度1e10~~
by a_little_carrot @ 2024-04-22 08:08:39


@[a_little_carrot](/user/1042960) 把区间离散化,check 的时候就 for 循环遍历离散化数组,跨区间判断距离是否大于等于 Mid,如果大于等于了就记录 cnt++(如果在同一个区间内取就 cnt+=首尾距离/mid,顺便记录余数方便跨区间判定) 完了之后判cnt是否大于N,时间复杂度 nlogn 口胡的,正确性不保证
by Rem_CandleFire @ 2024-04-22 08:14:22


@[Rem_CandleFire](/user/421421) 改为:判cnt大于等于N
by Rem_CandleFire @ 2024-04-22 08:15:00


@[Rem_CandleFire](/user/421421) 诶似乎不用离散化,只把区间排序更好,时间复杂度 mlog(1e18) + mlogm(排序)约等于80M
by Rem_CandleFire @ 2024-04-22 08:18:06


@[Rem_CandleFire](/user/421421) 感谢大佬 已关
by a_little_carrot @ 2024-04-22 08:56:06


@[Rem_CandleFire](/user/421421) https://www.luogu.com.cn/discuss/811175 qwq
by a_little_carrot @ 2024-04-22 11:54:28


@[a_little_carrot](/user/1042960) wc我不会箭头语言awa,你加油
by Rem_CandleFire @ 2024-04-22 14:32:45


| 下一页