F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

View Compilation Error

0_0_36333390_24258.cpp:1:307: error: too many decimal points in number
 {6955221    Master_Chivu    1177    Accepted    1948K    32MS    Pascal    4579B    2010-05-24 00:06:55}  2 const maxl=100000;maxn=100000;  3 type  4     treenode=  5         record  6         l,r:longint;  7         ls,lb,rb,m,cover:longint;  8         lc,rc:longint;  9         end; 10 var    tree:array[1..maxl shl 1-1]of treenode; 11     x1,x2,y1,y2:array[1..maxn]of longint; 12     y:array[1..maxn shl 1]of longint; 13     index:array[1..maxn shl 1]of record x,y1,y2,flag:longint; end; 14     ans,temp:int64; 15     n,t,i,tot,last:longint; 16 procedure sorty(l,r:longint); 17 var    i,j,temp,mid:longint; 18 begin 19 mid:=y[(l+r)shr 1]; 20 i:=l; j:=r; 21 repeat 22 while y[i]<mid do inc(i); 23 while mid<y[j] do dec(j); 24 if not(i>j) 25     then begin 26     temp:=y[i]; 27     y[i]:=y[j]; 28     y[j]:=temp; 29     inc(i); dec(j); 30     end; 31 until i>j; 32 if i<r then sorty(i,r); 33 if l<j then sorty(l,j); 34 end; 35 function find(x:longint):longint; 36 var    l,r,mid:longint; 37 begin 38 l:=1; r:=t; 39 while l<=r do 40     begin 41     mid:=(l+r)shr 1; 42     if x<y[mid] then r:=mid-1 43         else if y[mid]<x then l:=mid+1 44             else begin find:=mid; exit; end; 45     end; 46 end; 47 procedure sortindex(l,r:longint); 48 var    i,j,temp,mid1,mid2:longint; 49 begin 50 mid1:=index[(l+r)shr 1].x; 51 mid2:=index[(l+r)shr 1].flag; 52 i:=l; j:=r; 53 repeat 54 while (index[i].x<mid1)or((index[i].x=mid1)and(index[i].flag<mid2)) do inc(i); 55 while (mid1<index[j].x)or((mid1=index[j].x)and(mid2<index[j].flag)) do dec(j); 56 if not(i>j) 57     then begin 58     if (index[j].x<index[i].x)or((index[j].x=index[i].x)and(index[j].flag<index[i].flag)) 59         then begin 60         temp:=index[i].x; 61         index[i].x:=index[j].x; 62         index[j].x:=temp; 63         temp:=index[i].y1; 64         index[i].y1:=index[j].y1; 65         index[j].y1:=temp; 66         temp:=index[i].y2; 67         index[i].y2:=index[j].y2; 68         index[j].y2:=temp; 69         temp:=index[i].flag; 70         index[i].flag:=index[j].flag; 71         index[j].flag:=temp; 72         end; 73     inc(i); dec(j); 74     end; 75 until i>j; 76 if i<r then sortindex(i,r); 77 if l<j then sortindex(l,j); 78 end; 79 procedure build(a,b:longint); 80 var    mid,now:longint; 81 begin 82 inc(tot); 83 now:=tot; 84 tree[now].l:=a; 85 tree[now].r:=b; 86 if b-a>1 87     then begin 88     mid:=(a+b)shr 1; 89     tree[now].lc:=tot+1; 90     build(a,mid); 91     tree[now].rc:=tot+1; 92     build(mid,b); 93     end; 94 end; 95 procedure insert(x,a,b:longint); 96 var    mid:longint; 97 begin 98 if (a<=tree[x].l)and(tree[x].r<=b) 99     then inc(tree[x].cover)100     else begin101     mid:=(tree[x].l+tree[x].r)shr 1;102     if a<mid then insert(tree[x].lc,a,b);103     if mid<b then insert(tree[x].rc,a,b);104     end;105 if tree[x].cover>0106     then begin107     tree[x].m:=y[tree[x].r]-y[tree[x].l];108     tree[x].lb:=1; tree[x].rb:=1;109     tree[x].ls:=1;110     end111     else if (tree[x].cover=0)and(tree[x].r-tree[x].l=1)112         then begin113         tree[x].m:=0;114         tree[x].lb:=0; tree[x].rb:=0;115         tree[x].ls:=0;116         end117         else begin118         tree[x].m:=tree[tree[x].lc].m+tree[tree[x].rc].m;119         tree[x].lb:=tree[tree[x].lc].lb; tree[x].rb:=tree[tree[x].rc].rb;120         if (tree[tree[x].lc].rb=1)and(tree[tree[x].rc].lb=1)121             then tree[x].ls:=tree[tree[x].lc].ls+tree[tree[x].rc].ls-1122             else tree[x].ls:=tree[tree[x].lc].ls+tree[tree[x].rc].ls;123         end;124 end;125 procedure delete(x,a,b:longint);126 var    mid:longint;127 begin128 if (a<=tree[x].l)and(tree[x].r<=b)129     then dec(tree[x].cover)130     else begin131     mid:=(tree[x].l+tree[x].r)shr 1;132     if a<mid then delete(tree[x].lc,a,b);133     if mid<b then delete(tree[x].rc,a,b);134     end;135 if tree[x].cover>0136     then begin137     tree[x].m:=y[tree[x].r]-y[tree[x].l];138     tree[x].lb:=1; tree[x].rb:=1;139     tree[x].ls:=1;140     end141     else if (tree[x].cover=0)and(tree[x].r-tree[x].l=1)142         then begin143         tree[x].m:=0;144         tree[x].lb:=0; tree[x].rb:=0;145         tree[x].ls:=0;146         end147         else begin148         tree[x].m:=tree[tree[x].lc].m+tree[tree[x].rc].m;149         tree[x].lb:=tree[tree[x].lc].lb; tree[x].rb:=tree[tree[x].rc].rb;150         if (tree[tree[x].lc].rb=1)and(tree[tree[x].rc].lb=1)151             then tree[x].ls:=tree[tree[x].lc].ls+tree[tree[x].rc].ls-1152             else tree[x].ls:=tree[tree[x].lc].ls+tree[tree[x].rc].ls;153         end;154 end;155 begin156 assign(input,'picture.in');157 reset(input);158 assign(output,'picture.out');159 rewrite(output);160 readln(n);161 t:=0;162 for i:=1 to n do163     begin164     readln(x1[i],y1[i],x2[i],y2[i]);165     inc(t); y[t]:=y1[i];166     inc(t); y[t]:=y2[i];167     end;168 sorty(1,t);169 for i:=1 to n do170     begin171     y1[i]:=find(y1[i]);172     y2[i]:=find(y2[i]);173     end;174 t:=0;175 for i:=1 to n do176     begin177     inc(t);178     index[t].x:=x1[i];179     index[t].y1:=y1[i];180     index[t].y2:=y2[i];181     index[t].flag:=-1;182     inc(t);183     index[t].x:=x2[i];184     index[t].y1:=y1[i];185     index[t].y2:=y2[i];186     index[t].flag:=1;187     end;188 sortindex(1,t);189 tot:=0;190 build(0,t);191 ans:=0;192 last:=0;193 index[t+1].x:=index[t].x;194 for i:=1 to t do195     begin196     if index[i].flag=-1197         then insert(1,index[i].y1,index[i].y2)198         else delete(1,index[i].y1,index[i].y2);199     temp:=index[i+1].x-index[i].x;200     temp:=temp+temp;201     temp:=temp*tree[1].ls;202     temp:=temp+abs(tree[1].m-last);203     ans:=ans+temp;204     last:=tree[1].m;205     end;206 writeln(ans);207 close(input);208 close(output);209 end.210
                                                                                                                                                                                                                                                                                                                   ^
0_0_36333390_24258.cpp:1:361: error: too many decimal points in number
 {6955221    Master_Chivu    1177    Accepted    1948K    32MS    Pascal    4579B    2010-05-24 00:06:55}  2 const maxl=100000;maxn=100000;  3 type  4     treenode=  5         record  6         l,r:longint;  7         ls,lb,rb,m,cover:longint;  8         lc,rc:longint;  9         end; 10 var    tree:array[1..maxl shl 1-1]of treenode; 11     x1,x2,y1,y2:array[1..maxn]of longint; 12     y:array[1..maxn shl 1]of longint; 13     index:array[1..maxn shl 1]of record x,y1,y2,flag:longint; end; 14     ans,temp:int64; 15     n,t,i,tot,last:longint; 16 procedure sorty(l,r:longint); 17 var    i,j,temp,mid:longint; 18 begin 19 mid:=y[(l+r)shr 1]; 20 i:=l; j:=r; 21 repeat 22 while y[i]<mid do inc(i); 23 while mid<y[j] do dec(j); 24 if not(i>j) 25     then begin 26     temp:=y[i]; 27     y[i]:=y[j]; 28     y[j]:=temp; 29     inc(i); dec(j); 30     end; 31 until i>j; 32 if i<r then sorty(i,r); 33 if l<j then sorty(l,j); 34 end; 35 function find(x:longint):longint; 36 var    l,r,mid:longint; 37 begin 38 l:=1; r:=t; 39 while l<=r do 40     begin 41     mid:=(l+r)shr 1; 42     if x<y[mid] then r:=mid-1 43         else if y[mid]<x then l:=mid+1 44             else begin find:=mid; exit; end; 45     end; 46 end; 47 procedure sortindex(l,r:longint); 48 var    i,j,temp,mid1,mid2:longint; 49 begin 50 mid1:=index[(l+r)shr 1].x; 51 mid2:=index[(l+r)shr 1].flag; 52 i:=l; j:=r; 53 repeat 54 while (index[i].x<mid1)or((index[i].x=mid1)and(index[i].flag<mid2)) do inc(i); 55 while (mid1<index[j].x)or((mid1=index[j].x)and(mid2<index[j].flag)) do dec(j); 56 if not(i>j) 57     then begin 58     if (index[j].x<index[i].x)or((index[j].x=index[i].x)and(index[j].flag<index[i].flag)) 59         then begin 60         temp:=index[i].x; 61         index[i].x:=index[j].x; 62         index[j].x:=temp; 63         temp:=index[i].y1; 64         index[i].y1:=index[j].y1; 65         index[j].y1:=temp; 66         temp:=index[i].y2; 67         index[i].y2:=index[j].y2; 68         index[j].y2:=temp; 69         temp:=index[i].flag; 70         index[i].flag:=index[j].flag; 71         index[j].flag:=temp; 72         end; 73     inc(i); dec(j); 74     end; 75 until i>j; 76 if i<r then sortindex(i,r); 77 if l<j then sortindex(l,j); 78 end; 79 procedure build(a,b:longint); 80 var    mid,now:longint; 81 begin 82 inc(tot); 83 now:=tot; 84 tree[now].l:=a; 85 tree[now].r:=b; 86 if b-a>1 87     then begin 88     mid:=(a+b)shr 1; 89     tree[now].lc:=tot+1; 90     build(a,mid); 91     tree[now].rc:=tot+1; 92     build(mid,b); 93     end; 94 end; 95 procedure insert(x,a,b:longint); 96 var    mid:longint; 97 begin 98 if (a<=tree[x].l)and(tree[x].r<=b) 99     then inc(tree[x].cover)100     else begin101     mid:=(tree[x].l+tree[x].r)shr 1;102     if a<mid then insert(tree[x].lc,a,b);103     if mid<b then insert(tree[x].rc,a,b);104     end;105 if tree[x].cover>0106     then begin107     tree[x].m:=y[tree[x].r]-y[tree[x].l];108     tree[x].lb:=1; tree[x].rb:=1;109     tree[x].ls:=1;110     end111     else if (tree[x].cover=0)and(tree[x].r-tree[x].l=1)112         then begin113         tree[x].m:=0;114         tree[x].lb:=0; tree[x].rb:=0;115         tree[x].ls:=0;116         end117         else begin118         tree[x].m:=tree[tree[x].lc].m+tree[tree[x].rc].m;119         tree[x].lb:=tree[tree[x].lc].lb; tree[x].rb:=tree[tree[x].rc].rb;120         if (tree[tree[x].lc].rb=1)and(tree[tree[x].rc].lb=1)121             then tree[x].ls:=tree[tree[x].lc].ls+tree[tree[x].rc].ls-1122             else tree[x].ls:=tree[tree[x].lc].ls+tree[tree[x].rc].ls;123         end;124 end;125 procedure delete(x,a,b:longint);126 var    mid:longint;127 begin128 if (a<=tree[x].l)and(tree[x].r<=b)129     then dec(tree[x].cover)130     else begin131     mid:=(tree[x].l+tree[x].r)shr 1;132     if a<mid then delete(tree[x].lc,a,b);133     if mid<b then delete(tree[x].rc,a,b);134     end;135 if tree[x].cover>0136     then begin137     tree[x].m:=y[tree[x].r]-y[tree[x].l];138     tree[x].lb:=1; tree[x].rb:


Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-22 14:51:50, Gzip enabled