YY_More

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2011年7月30日

摘要: 裸的斜率优化,去年的APIO怎么有此等水题。//By YY_More#include<cstdio>struct point{ long long x,y;} now,D[1000010]; long long sum[1000010]; int L,R,n,a,b,c;inline long long xmul(point p,point q,point s){ return (q.x-p.x)*(s.y-p.y)-(q.y-p.y)*(s.x-p.x);} int main(){ scanf("%d",&n); scanf("%d%d%d& 阅读全文
posted @ 2011-07-30 20:30 YY_More 阅读(432) 评论(0) 推荐(0) 编辑

摘要: 裸斜率优化,不解释//By YY_More#include<cstdio>struct point{ int x,y;} D[500010],now;int sum[500010];int N,M,L,R;int xmul(point a,point b,point c){ return (b.x-a.x)*(c.y-a.y)-(b.y-a.y)*(c.x-a.x);} int main(){ while (~scanf("%d%d",&N,&M)){ sum[0]=0; for (int i=1;i<=N;i++){ scanf(&quo 阅读全文
posted @ 2011-07-30 20:29 YY_More 阅读(286) 评论(0) 推荐(0) 编辑

摘要: 斜率优化基础//By YY_More#include<cstdio>#include<algorithm>using namespace std;struct node{ int x,y;} now,stack[100010];double ans;int n,k,sum[100010],head,tail;long long xmul(node a,node b,node c){ return (long long)((b.x-a.x)*(c.y-a.y)-(b.y-a.y)*(c.x-a.x));} int main(){ while(~scanf("%d 阅读全文
posted @ 2011-07-30 20:27 YY_More 阅读(205) 评论(0) 推荐(0) 编辑