2586 区间最大子段和
题目详情见 [Ynoi2018] 末日时在做什么?有没有空?可以来拯救吗?
这里只放代码:
#include<cstdio>
#include<algorithm>
using namespace std;const int N=1e5+10;const int B=110;typedef long long ll;int n;int m;const ll minf=-(1LL<<47);//点结构体,叉积计算
struct poi{ll x;ll y;friend poi operator +(poi a,poi b){return (poi){a.x+b.x,a.y+b.y};}};
inline bool cmp(const poi& a,const poi& b,const poi& c){return (a.y-c.y)*(a.x-b.x)>=(a.y-b.y)*(a.x-c.x);}
inline bool cmp(const poi& a,const poi& b,const ll& k){return k*(b.x-a.x)>=b.y-a.y;}
inline bool cmp(const poi& a,const poi& b,const poi& c,const poi& d)
{return (c.y-d.y)*(a.x-b.x)>=(a.y-b.y)*(c.x-d.x);}
inline void chull(poi* s

博客探讨了Ynoi2018比赛中的2586题——区间最大子段和。文章提供了问题的详细说明,并分享了解决该问题的代码实现。
最低0.47元/天 解锁文章
1万+

被折叠的 条评论
为什么被折叠?



