0_0_21602435_12694.cpp:1:23: error: stray '\' in program
/*线段树扫描线*/\n/*从下往上扫描*/\n#include<cstdio>\n#include<cmath>\n#include<cstring>\n#include<algorithm>\n#include<iostream>\n\nusing namespace std;\n#define lson rt<<1\n#define rson rt<<1|1\nconst int maxn = 2e2+10;//最多只有100个点\nint n;//矩形数\nint e,p;//边数和点数\n//边\nstruct Edge{\n double l,r;//边的左右两点\n double h;//边的高度\n int tag;//边的标记,+1or-1,1代表下边,-1代表上边\n};\nEdge edge[maxn];\n//线段树\nstruct SegTree{\n int l,r;//线段树\n int tag;//标记\n double len;//长度\n};\nSegTree st[maxn<<2];\ndouble x[maxn];//离散化之后的横坐标点\n\ninline void GetEdge( double l, double r, double h, int tag)\n{\n edge[e].l = l;\n edge[e].r = r;\n edge[e].h = h;\n edge[e].tag = tag;\n e++;\n}\n\ninline void GetPoint( double xi)\n{\n x[p++] = xi;\n}\n\n//按照高度从小到大排序\nbool cmp( Edge p, Edge q)\n{\n return p.h < q.h;\n}\n\nvoid Build( int l, int r, int rt)\n{\n st[rt].l = l;\n st[rt].r = r;\n st[rt].tag = st[rt].len = 0;\n if( l == r)\n return;\n int mid = (l+r)>>1;\n Build(l,mid,lson);\n Build(mid+1,r,rson);\n //本题不PushUp\n}\n\nvoid PushUp( int rt)\n{\n printf("tag=%d\n",st[rt].tag);\n if( st[rt].tag)//tag>0,说明是下边,直接求出长度\n st[rt].len = x[st[rt].r+1]-x[st[rt].l];\n else if( st[rt].l == st[rt].r)//是个点,长度为0\n st[rt].len = 0;\n else//长度为儿子结点长度之和\n st[rt].len = st[lson].len+st[rson].len;\n}\n\nvoid Update( int L, int R, int rt, int tag)\n{\n if( L <= st[rt].l && R >= st[rt].r)\n {\n st[rt].tag += tag;\n PushUp(rt);\n return;\n }\n int mid = (st[rt].l+st[rt].r)>>1;\n if( R <= mid)\n Update(L,R,lson,tag);\n else if( L > mid)\n Update(L,R,rson,tag);\n else\n {\n Update(L,mid,lson,tag);\n Update(mid+1,R,rson,tag);\n }\n PushUp(rt);\n}\n\nint main()\n{\n while( ~scanf("%d",&n) && n)\n {\n e = 0;\n p = 0;\n double x1,y1,x2,y2;\n for( int i = 0; i < n; i++)\n {\n scanf("%lf%lf%lf%lf",&x1,&y1,&x2,&y2);\n GetEdge(x1,x2,y1,1);//底边\n GetEdge(x1,x2,y2,-1);//定边\n GetPoint(x1);//左端点\n GetPoint(x2);//右端点\n }\n sort(edge,edge+e,cmp);\n sort(x,x+p);\n\n //点去重\n int tmp = p;\n p = 1;\n for( int i = 1; i < tmp; i++)\n if( x[i] != x[i-1])\n x[p++] = x[i];\n\n //建树\n Build(0,p-1,1);\n double ans = 0;\n for( int i = 0; i < e-1; i++)\n {\n int l = lower_bound(x,x+p,edge[i].l)-x;\n int r = lower_bound(x,x+p,edge[i].r)-x-1;\n Update(l,r,1,edge[i].tag);\n ans += (edge[i+1].h-edge[i].h)*st[1].len;\n }\n static int cas = 1;\n printf("Test case #%d\n",cas++);\n printf("Total explored area: %.2f\n\n",ans);\n\n }\n\n return 0;\n}\n
^
0_0_21602435_12694.cpp:1:23: error: stray '\' in program
0_0_21602435_12694.cpp:1:49: error: stray '#' in program
/*线段树扫描线*/\n/*从下往上扫描*/\n#include<cstdio>\n#include<cmath>\n#include<cstring>\n#include<algorithm>\n#include<iostream>\n\nusing namespace std;\n#define lson rt<<1\n#define rson rt<<1|1\nconst int maxn = 2e2+10;//最多只有100个点\nint n;//矩形数\nint e,p;//边数和点数\n//边\nstruct Edge{\n double l,r;//边的左右两点\n double h;//边的高度\n int tag;//边的标记,+1or-1,1代表下边,-1代表上边\n};\nEdge edge[maxn];\n//线段树\nstruct SegTree{\n int l,r;//线段树\n int tag;//标记\n double len;//长度\n};\nSegTree st[maxn<<2];\ndouble x[maxn];//离散化之后的横坐标点\n\ninline void GetEdge( double l, double r, double h, int tag)\n{\n edge[e].l = l;\n edge[e].r = r;\n edge[e].h = h;\n edge[e].tag = tag;\n e++;\n}\n\ninline void GetPoint( double xi)\n{\n x[p++] = xi;\n}\n\n//按照高度从小到大排序\nbool cmp( Edge p, Edge q)\n{\n return p.h < q.h;\n}\n\nvoid Build( int l, int r, int rt)\n{\n st[rt].l = l;\n st[rt].r = r;\n st[rt].tag = st[rt].len = 0;\n if( l == r)\n return;\n int mid = (l+r)>>1;\n Build(l,mid,lson);\n Build(mid+1,r,rson);\n //本题不PushUp\n}\n\nvoid PushUp( int rt)\n{\n printf("tag=%d\n",st[rt].tag);\n if( st[rt].tag)//tag>0,说明是下边,直接求出长度\n st[rt].len = x[st[rt].r+1]-x[st[rt].l];\n else if( st[rt].l == st[rt].r)//是个点,长度为0\n st[rt].len = 0;\n else//长度为儿子结点长度之和\n st[rt].len = st[lson].len+st[rson].len;\n}\n\nvoid Update( int L, int R, int rt, int tag)\n{\n if( L <= st[rt].l && R >= st[rt].r)\n {\n st[rt].tag += tag;\n PushUp(rt);\n return;\n }\n int mid = (st[rt].l+st[rt].r)>>1;\n if( R <= mid)\n Update(L,R,lson,tag);\n else if( L > mid)\n Update(L,R,rson,tag);\n else\n {\n Update(L,mid,lson,tag);\n Update(mid+1,R,rson,tag);\n }\n PushUp(rt);\n}\n\nint main()\n{\n while( ~scanf("%d",&n) && n)\n {\n e = 0;\n p = 0;\n double x1,y1,x2,y2;\n for( int i = 0; i < n; i++)\n {\n scanf("%lf%lf%lf%lf",&x1,&y1,&x2,&y2);\n GetEdge(x1,x2,y1,1);//底边\n GetEdge(x1,x2,y2,-1);//定边\n GetPoint(x1);//左端点\n GetPoint(x2);//右端点\n }\n sort(edge,edge+e,cmp);\n sort(x,x+p);\n\n //点去重\n int tmp = p;\n p = 1;\n for( int i = 1; i < tmp; i++)\n if( x[i] != x[i-1])\n x[p++] = x[i];\n\n //建树\n Build(0,p-1,1);\n double ans = 0;\n for( int i = 0; i < e-1; i++)\n {\n int l = lower_bound(x,x+p,edge[i].l)-x;\n int r = lower_bound(x,x+p,edge[i].r)-x-1;\n Update(l,r,1,edge[i].tag);\n ans += (edge[i+1].h-edge[i].h)*st[1].len;\n }\n static int cas = 1;\n printf("Test case #%d\n",cas++);\n printf("Total explored area: %.2f\n\n",ans);\n\n }\n\n return 0;\n}\n
^
0_0_21602435_12694.cpp:1:23: error: stray '\' in program
/*线段树扫描线*/\n/*从下往上扫描*/\n#include<cstdio>\n#include<cmath>\n#include<cstring>\n#include<algorithm>\n#include<iostream>\n\nusing namespace std;\n#define lson rt<<1\n#define rson rt<<1|1\nconst int maxn = 2e2+10;//最多只有100个点\nint n;//矩形数\nint e,p;//边数和点数\n//边\nstruct Edge{\n double l,r;//边的左右两点\n double h;//边的高度\n int tag;//边的标记,+1or-1,1代表下边,-1代表上边\n};\nEdge edge[maxn];\n//线段树\nstruct SegTree{\n int l,r;//线段树\n int tag;//标记\n double len;//长度\n};\nSegTree st[maxn<<2];\ndouble x[maxn];//离散化之后的横坐标点\n\ninline void GetEdge( double l, double r, double h, int tag)\n{\n edge[e].l = l;\n edge[e].r = r;\n edge[e].h = h;\n edge[e].tag = tag;\n e++;\n}\n\ninline void GetPoint( double xi)\n{\n x[p++] = xi;\n}\n\n//按照高度从小到大排序\nbool cmp( Edge p, Edge q)\n{\n return p.h < q.h;\n}\n\nvoid Build( int l, int r, int rt)\n{\n st[rt].l = l;\n st[rt].r = r;\n st[rt].tag = st[rt].len = 0;\n if( l == r)\n return;\n int mid = (l+r)>>1;\n Build(l,mid,lson);\n Build(mid+1,r,rson);\n //本题不PushUp\n}\n\nvoid PushUp( int rt)\n{\n printf("tag=%d\n",st[rt].tag);\n if( st[rt].tag)//tag>0,说明是下边,直接求出长度\n st[rt].len = x[st[rt].r+1]-x[st[rt].l];\n else if( st[rt].l == st[rt].r)//是个点,长度为0\n st[rt].len = 0;\n else//长度为儿子结点长度之和\n st[rt].len = st[lson].len+st[rson].len;\n}\n\nvoid Update( int L, int R, int rt, int tag)\n{\n if( L <= st[rt].l && R >= st[rt].r)\n {\n st[rt].tag += tag;\n PushUp(rt);\n return;\n }\n int mid = (st[rt].l+st[rt].r)>>1;\n if( R <= mid)\n Update(L,R,lson,tag);\n else if( L > mid)\n Update(L,R,rson,tag);\n else\n {\n Update(L,mid,lson,tag);\n Update(mid+1,R,rson,tag);\n }\n PushUp(rt);\n}\n\nint main()\n{\n while( ~scanf("%d",&n) && n)\n {\n e = 0;\n p = 0;\n double x1,y1,x2,y2;\n for( int i = 0; i < n; i++)\n {\n scanf("%lf%lf%lf%lf",&x1,&y1,&x2,&y2);\n GetEdge(x1,x2,y1,1);//底边\n GetEdge(x1,x2,y2,-1);//定边\n GetPoint(x1);//左端点\n GetPoint(x2);//右端点\n }\n sort(edge,edge+e,cmp);\n sort(x,x+p);\n\n //点去重\n int tmp = p;\n p = 1;\n for( int i = 1; i < tmp; i++)\n if( x[i] != x[i-1])\n x[p++] = x[i];\n\n //建树\n Build(0,p-1,1);\n double ans = 0;\n for( int i = 0; i < e-1; i++)\n {\n int l = lower_bound(x,x+p,edge[i].l)-x;\n int r = lower_bound(x,x+p,edge[i].r)-x-1;\n Update(l,r,1,edge[i].tag);\n ans += (edge[i+1].h-edge[i].h)*st[1].len;\n }\n static int cas = 1;\n printf("Test case #%d\n",cas++);\n printf("Total explored area: %.2f\n\n",ans);\n\n }\n\n return 0;\n}\n
^
0_0_21602435_12694.cpp:1:67: error: stray '#' in program
/*线段树扫描线*/\n/*从下往上扫描*/\n#include<cstdio>\n#include<cmath>\n#include<cstring>\n#include<algorithm>\n#include<iostream>\n\nusing namespace std;\n#define lson rt<<1\n#define rson rt<<1|1\nconst int maxn = 2e2+10;//最多只有100个点\nint n;//矩形数\nint e,p;//边数和点数\n//边\nstruct Edge{\n double l,r;//边的左右两点\n double h;//边的高度\n int tag;//边的标记,+1or-1,1代表下边,-1代表上边\n};\nEdge edge[maxn];\n//线段树\nstruct Se
|