请求加强数据

P2512 [HAOI2008] 糖果传递

@[WYXkk](/user/130151) @[chen_zhe](/user/8457)
by Rubidium_Chloride @ 2021-08-08 13:48:36


随便卡吧 ```cpp input: 5 1 2 3 4 5 answer: 4 output: 5 ```
by cyffff @ 2021-08-08 13:52:22


哦对要换行 ```cpp input: 5 1 2 3 4 5 ```
by cyffff @ 2021-08-08 13:52:54


[数据太大了只能作为测试点上传了……希望管理能下下来加进题目里](https://www.luogu.com.cn/problem/U172691)
by Rubidium_Chloride @ 2021-08-08 14:18:37


?为什么要那么大的点,我的那个就够了(
by cyffff @ 2021-08-08 14:30:17


@[cyffff](/user/365127) 卡一卡,多卡一卡,而且你那个可能被特判判掉?
by Rubidium_Chloride @ 2021-08-08 14:31:09


ll query(ll l,ll r){return s[r]-s[l-1];} for(ll i=1;i<=n;++i)s[i]=s[i-1]+b[i]; for(ll i=1;i<=n;++i){ ll now=query(i+1,n)-query(1,i-1)+(2*i-n-1)*b[i]; ans=min(ans,now); } 直接暴搜就好了(
by Maxwell_dcc @ 2021-08-08 16:15:54


至少暴力能过5e6的数据(实测) 暴力只是O(n) sort()已经nlogn了还怕啥
by Maxwell_dcc @ 2021-08-08 16:23:42


|