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_20612592_30445.cpp:5:5: error: expected unqualified-id before '>' token
     >1;                         if(b[mid]==key) return mid;         if(b[mid]<key)             l=mid+1;         else            r=mid-1;     }    }  void insert(int p,int d) {      for(int i=p;i<=k;i+=lowbit(i))      {          e[i]+=d;            e[i]%=mod;      } }   __int64 query(int p)  {      __int64 sum=0;      for(int i=p;i>0;i-=lowbit(i))       {          sum+=e[i];          sum%=mod;              }        return sum;       }int main(int argc, char *argv[]){     int t,cas=1;     __int64 n,m,x,y,z;    scanf("%d",&t);    while(t--)    {        scanf("%I64d%I64d%I64d%I64d%I64d",&n,&m,&x,&y,&z);        for(int i=0;i<m;i++)             scanf("%I64d",&a[i]);         for(int i=0;i<=n-1;i++)         {             b[i+1]=a[i%m];             c[i+1]=b[i+1];             a[i%m]=(x*a[i%m]+y*(i+1))%z;        }         sort(b+1,b+1+n);         k = 1;         for(int i=2;i<=n;i++)          if(b[i]!=b[i-1])  b[++k]=b[i];         memset(e,0,sizeof(e));         __int64 sum= 0 ;         for(int i=1;i<=n;i++)         {           int  ans = find(c[i]);           int num=query(ans-1);           num%=mod;           sum+=num+1;           sum%=mod;           insert(ans,num+1);         }     printf("Case #%d: %I64d\n",cas++,sum);    }     return 0;}
     ^
0_0_20612592_30445.cpp:5:33: error: expected unqualified-id before 'if'
     >1;                         if(b[mid]==key) return mid;         if(b[mid]<key)             l=mid+1;         else            r=mid-1;     }    }  void insert(int p,int d) {      for(int i=p;i<=k;i+=lowbit(i))      {          e[i]+=d;            e[i]%=mod;      } }   __int64 query(int p)  {      __int64 sum=0;      for(int i=p;i>0;i-=lowbit(i))       {          sum+=e[i];          sum%=mod;              }        return sum;       }int main(int argc, char *argv[]){     int t,cas=1;     __int64 n,m,x,y,z;    scanf("%d",&t);    while(t--)    {        scanf("%I64d%I64d%I64d%I64d%I64d",&n,&m,&x,&y,&z);        for(int i=0;i<m;i++)             scanf("%I64d",&a[i]);         for(int i=0;i<=n-1;i++)         {             b[i+1]=a[i%m];             c[i+1]=b[i+1];             a[i%m]=(x*a[i%m]+y*(i+1))%z;        }         sort(b+1,b+1+n);         k = 1;         for(int i=2;i<=n;i++)          if(b[i]!=b[i-1])  b[++k]=b[i];         memset(e,0,sizeof(e));         __int64 sum= 0 ;         for(int i=1;i<=n;i++)         {           int  ans = find(c[i]);           int num=query(ans-1);           num%=mod;           sum+=num+1;           sum%=mod;           insert(ans,num+1);         }     printf("Case #%d: %I64d\n",cas++,sum);    }     return 0;}
                                 ^
0_0_20612592_30445.cpp:5:69: error: expected unqualified-id before 'if'
     >1;                         if(b[mid]==key) return mid;         if(b[mid]<key)             l=mid+1;         else            r=mid-1;     }    }  void insert(int p,int d) {      for(int i=p;i<=k;i+=lowbit(i))      {          e[i]+=d;            e[i]%=mod;      } }   __int64 query(int p)  {      __int64 sum=0;      for(int i=p;i>0;i-=lowbit(i))       {          sum+=e[i];          sum%=mod;              }        return sum;       }int main(int argc, char *argv[]){     int t,cas=1;     __int64 n,m,x,y,z;    scanf("%d",&t);    while(t--)    {        scanf("%I64d%I64d%I64d%I64d%I64d",&n,&m,&x,&y,&z);        for(int i=0;i<m;i++)             scanf("%I64d",&a[i]);         for(int i=0;i<=n-1;i++)         {             b[i+1]=a[i%m];             c[i+1]=b[i+1];             a[i%m]=(x*a[i%m]+y*(i+1))%z;        }         sort(b+1,b+1+n);         k = 1;         for(int i=2;i<=n;i++)          if(b[i]!=b[i-1])  b[++k]=b[i];         memset(e,0,sizeof(e));         __int64 sum= 0 ;         for(int i=1;i<=n;i++)         {           int  ans = find(c[i]);           int num=query(ans-1);           num%=mod;           sum+=num+1;           sum%=mod;           insert(ans,num+1);         }     printf("Case #%d: %I64d\n",cas++,sum);    }     return 0;}
                                                                     ^
0_0_20612592_30445.cpp:5:113: error: expected unqualified-id before 'else'
     >1;                         if(b[mid]==key) return mid;         if(b[mid]<key)             l=mid+1;         else            r=mid-1;     }    }  void insert(int p,int d) {      for(int i=p;i<=k;i+=lowbit(i))      {          e[i]+=d;            e[i]%=mod;      } }   __int64 query(int p)  {      __int64 sum=0;      for(int i=p;i>0;i-=lowbit(i))       {          sum+=e[i];          sum%=mod;              }        return sum;       }int main(int argc, char *argv[]){     int t,cas=1;     __int64 n,m,x,y,z;    scanf("%d",&t);    while(t--)    {        scanf("%I64d%I64d%I64d%I64d%I64d",&n,&m,&x,&y,&z);        for(int i=0;i<m;i++)             scanf("%I64d",&a[i]);         for(int i=0;i<=n-1;i++)         {             b[i+1]=a[i%m];             c[i+1]=b[i+1];             a[i%m]=(x*a[i%m]+y*(i+1))%z;        }         sort(b+1,b+1+n);         k = 1;         for(int i=2;i<=n;i++)          if(b[i]!=b[i-1])  b[++k]=b[i];         memset(e,0,sizeof(e));         __int64 sum= 0 ;         for(int i=1;i<=n;i++)         {           int  ans = find(c[i]);           int num=query(ans-1);           num%=mod;           sum+=num+1;           sum%=mod;           insert(ans,num+1);         }     printf("Case #%d: %I64d\n",cas++,sum);    }     return 0;}
                                                                                                                 ^
0_0_20612592_30445.cpp:5:142: error: expected declaration before '}' token
     >1;                         if(b[mid]==key) return mid;         if(b[mid]<key)             l=mid+1;         else            r=mid-1;     }    }  void insert(int p,int d) {      for(int i=p;i<=k;i+=lowbit(i))      {          e[i]+=d;            e[i]%=mod;      } }   __int64 query(int p)  {      __int64 sum=0;      for(int i=p;i>0;i-=lowbit(i))       {          sum+=e[i];          sum%=mod;              }        return sum;       }int main(int argc, char *argv[]){     int t,cas=1;     __int64 n,m,x,y,z;    scanf("%d",&t);    while(t--)    {        scanf("%I64d%I64d%I64d%I64d%I64d",&n,&m,&x,&y,&z);        for(int i=0;i<m;i++)             scanf("%I64d",&a[i]);         for(int i=0;i<=n-1;i++)         {             b[i+1]=a[i%m];             c[i+1]=b[i+1];             a[i%m]=(x*a[i%m]+y*(i+1))%z;        }         sort(b+1,b+1+n);         k = 1;         for(int i=2;i<=n;i++)          if(b[i]!=b[i-1])  b[++k]=b[i];         memset(e,0,sizeof(e));         __int64 sum= 0 ;         for(int i=1;i<=n;i++)         {           int  ans = find(c[i]);           int num=query(ans-1);           num%=mod;           sum+=num+1;           sum%=mod;           insert(ans,num+1);         }     printf("Case #%d: %I64d\n",cas++,sum);    }     return 0;}
                                                                                                                                              ^


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-25 15:23:52, Gzip enabled