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_23251015_12817.cpp:103:1: error: expected unqualified-id before '[' token
 [cpp] 
 ^
0_0_23251015_12817.cpp:107:43: error: conflicting declaration 'bool b'
            int x,l,r,f=nil;          bool b=false;          cut(root,l,r,k);          if(l!=nil){              b=true;              x=l;              while(T[x].r!=nil)f=x,x=T[x].r;              if(f==nil)merge(l,T[x].l,T[x].r);              else merge(T[f].r,T[x].l,T[x].r);//???x           }          merge(root,l,r);          return b;      }      void  dfs(int x){          if(x==nil)return;          dfs(T[x].l);          cout<<T[x].k<<" ";          dfs(T[x].r);      }  };  /***********************************************/  int main(){      int n,i,j,T,ans;      scanf("%d",&T);      while(T--){          scanf("%d",&n);          for(i=0;i<n;i++)scanf("%d%d",&a[i].h,&a[i].w),a[i].id=1;          for(i=n;i<2*n;i++)scanf("%d%d",&a[i].h,&a[i].w),a[i].id=0;          sort(a,a+2*n);          ans=0;          Treap treap;          /*for(i=0;i<10;i++)treap.insert(i);         treap.find(5);             treap.dfs(treap.root);cout<<endl;*/          for(i=0;i<2*n;i++){              if(a[i].id==1){                  if(treap.find(a[i].h))ans++;              }else treap.insert(a[i].h);          }          printf("%d\n",ans);      }  return 0;  }  //Treap???????
                                           ^
0_0_23251015_12817.cpp:45:19: note: previous declaration as 'std::multiset<node, cmp> b'
 multiset<node,cmp>b;
                   ^
0_0_23251015_12817.cpp:107:64: error: expected constructor, destructor, or type conversion before '(' token
            int x,l,r,f=nil;          bool b=false;          cut(root,l,r,k);          if(l!=nil){              b=true;              x=l;              while(T[x].r!=nil)f=x,x=T[x].r;              if(f==nil)merge(l,T[x].l,T[x].r);              else merge(T[f].r,T[x].l,T[x].r);//???x           }          merge(root,l,r);          return b;      }      void  dfs(int x){          if(x==nil)return;          dfs(T[x].l);          cout<<T[x].k<<" ";          dfs(T[x].r);      }  };  /***********************************************/  int main(){      int n,i,j,T,ans;      scanf("%d",&T);      while(T--){          scanf("%d",&n);          for(i=0;i<n;i++)scanf("%d%d",&a[i].h,&a[i].w),a[i].id=1;          for(i=n;i<2*n;i++)scanf("%d%d",&a[i].h,&a[i].w),a[i].id=0;          sort(a,a+2*n);          ans=0;          Treap treap;          /*for(i=0;i<10;i++)treap.insert(i);         treap.find(5);             treap.dfs(treap.root);cout<<endl;*/          for(i=0;i<2*n;i++){              if(a[i].id==1){                  if(treap.find(a[i].h))ans++;              }else treap.insert(a[i].h);          }          printf("%d\n",ans);      }  return 0;  }  //Treap???????
                                                                ^
0_0_23251015_12817.cpp:107:87: error: expected unqualified-id before 'if'
            int x,l,r,f=nil;          bool b=false;          cut(root,l,r,k);          if(l!=nil){              b=true;              x=l;              while(T[x].r!=nil)f=x,x=T[x].r;              if(f==nil)merge(l,T[x].l,T[x].r);              else merge(T[f].r,T[x].l,T[x].r);//???x           }          merge(root,l,r);          return b;      }      void  dfs(int x){          if(x==nil)return;          dfs(T[x].l);          cout<<T[x].k<<" ";          dfs(T[x].r);      }  };  /***********************************************/  int main(){      int n,i,j,T,ans;      scanf("%d",&T);      while(T--){          scanf("%d",&n);          for(i=0;i<n;i++)scanf("%d%d",&a[i].h,&a[i].w),a[i].id=1;          for(i=n;i<2*n;i++)scanf("%d%d",&a[i].h,&a[i].w),a[i].id=0;          sort(a,a+2*n);          ans=0;          Treap treap;          /*for(i=0;i<10;i++)treap.insert(i);         treap.find(5);             treap.dfs(treap.root);cout<<endl;*/          for(i=0;i<2*n;i++){              if(a[i].id==1){                  if(treap.find(a[i].h))ans++;              }else treap.insert(a[i].h);          }          printf("%d\n",ans);      }  return 0;  }  //Treap???????
                                                                                       ^
In file included from GCC4.9.2/x86_64-w64-mingw32/include/c++/ctime:42:0,
                 from 0_0_23251015_12817.cpp:120:
GCC4.9.2/x86_64-w64-mingw32/include/time.h:15:32: error: expected declaration before end of line
 #pragma pack(push,_CRT_PACKING)
                                ^


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-30 09:19:13, Gzip enabled