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_20614643_24442.cpp:5:25: error: stray '#' in program
     using namespace std;#define maxn 200007int wwa[maxn],wwb[maxn],wwv[maxn],wws[maxn];int cmp(int *r,int a,int b,int l){    return r[a]==r[b]&&r[a+l]==r[b+l];} void da(int *r,int *sufix,int n,int m){    int i,j,p,*x=wwa,*y=wwb,*t;    for(i=0;i<m;i++)wws[i]=0;    for(i=0;i<n;i++)wws[x[i]=r[i]]++;    for(i=1;i<m;i++)wws[i]+=wws[i-1];    for(i=n-1;i>=0;i--)sufix[--wws[x[i]]]=i;    for(j=1,p=1;p<n;j*=2,m=p){        for(p=0,i=n-j;i<n;i++)y[p++]=i;        for(i=0;i<n;i++)            if(sufix[i]>=j)                y[p++]=sufix[i]-j;        for(i=0;i<n;i++)wwv[i]=x[y[i]];        for(i=0;i<m;i++)wws[i]=0;        for(i=0;i<n;i++)wws[wwv[i]]++;        for(i=1;i<m;i++)wws[i]+=wws[i-1];        for(i=n-1;i>=0;i--)            sufix[--wws[wwv[i]]]=y[i];        for(t=x,x=y,y=t,p=1,x[sufix[0]]=0,i=1;i<n;i++)            x[sufix[i]]=cmp(y,sufix[i-1],sufix[i],j)?p-1:p++;     }    return;}int r[maxn];int rank1[maxn],height[maxn],sufix[maxn];void calheight(int *r,int *sufix,int n){    int i,j,k=0;    for(i=0;i<=n;i++) rank1[sufix[i]]=i;    for(i=0;i<n;height[rank1[i++]]=k)        for(k?k--:0,j=sufix[rank1[i]-1];r[i+k]==r[j+k];k++);    return;}struct Node{    int p,c;};int comp(Node a,Node b){    if(a.p == b.p) return a.c < b.c;    return a.p < b.p;} Node ans[maxn]; char word[maxn]; int main(){    int t,n;    scanf("%d",&t);    while(t--){        scanf("%d",&n);        scanf("%s",word);        for(int i = 0;i < n; i++){            r[i]=r[i+n] = word[i];        }        int len =n*4+1;        r[n*2] = '#';        for(int i = 0;i < n; i++){            r[i+n*2+1] = r[i+n*3+1] = word[n-i-1];        }        r[len] = 0;        da(r,sufix,len+1,328);        calheight(r,sufix,len);        int cnt = 0;        ans[cnt++].p = sufix[len];        for(int i = len-1;i > 1; i--){            if(height[i+1] < n) break;            if(sufix[i]>=n&&sufix[i]<=n*2) continue;            if(sufix[i]>=n*3+1)continue;            ans[cnt++].p = sufix[i];        }        for(int i = 0;i < cnt; i++){            if(ans[i].p > 2*n){                ans[i].c =1;                ans[i].p = n-(ans[i].p-2*n-1);            }            else {                ans[i].p++;                ans[i].c =  0;            }        }        sort(ans,ans+cnt,comp);        printf("%d %d\n",ans[0].p,ans[0].c);    }    return 0;}
                         ^
0_0_20614643_24442.cpp:5:26: error: 'define' does not name a type
     using namespace std;#define maxn 200007int wwa[maxn],wwb[maxn],wwv[maxn],wws[maxn];int cmp(int *r,int a,int b,int l){    return r[a]==r[b]&&r[a+l]==r[b+l];} void da(int *r,int *sufix,int n,int m){    int i,j,p,*x=wwa,*y=wwb,*t;    for(i=0;i<m;i++)wws[i]=0;    for(i=0;i<n;i++)wws[x[i]=r[i]]++;    for(i=1;i<m;i++)wws[i]+=wws[i-1];    for(i=n-1;i>=0;i--)sufix[--wws[x[i]]]=i;    for(j=1,p=1;p<n;j*=2,m=p){        for(p=0,i=n-j;i<n;i++)y[p++]=i;        for(i=0;i<n;i++)            if(sufix[i]>=j)                y[p++]=sufix[i]-j;        for(i=0;i<n;i++)wwv[i]=x[y[i]];        for(i=0;i<m;i++)wws[i]=0;        for(i=0;i<n;i++)wws[wwv[i]]++;        for(i=1;i<m;i++)wws[i]+=wws[i-1];        for(i=n-1;i>=0;i--)            sufix[--wws[wwv[i]]]=y[i];        for(t=x,x=y,y=t,p=1,x[sufix[0]]=0,i=1;i<n;i++)            x[sufix[i]]=cmp(y,sufix[i-1],sufix[i],j)?p-1:p++;     }    return;}int r[maxn];int rank1[maxn],height[maxn],sufix[maxn];void calheight(int *r,int *sufix,int n){    int i,j,k=0;    for(i=0;i<=n;i++) rank1[sufix[i]]=i;    for(i=0;i<n;height[rank1[i++]]=k)        for(k?k--:0,j=sufix[rank1[i]-1];r[i+k]==r[j+k];k++);    return;}struct Node{    int p,c;};int comp(Node a,Node b){    if(a.p == b.p) return a.c < b.c;    return a.p < b.p;} Node ans[maxn]; char word[maxn]; int main(){    int t,n;    scanf("%d",&t);    while(t--){        scanf("%d",&n);        scanf("%s",word);        for(int i = 0;i < n; i++){            r[i]=r[i+n] = word[i];        }        int len =n*4+1;        r[n*2] = '#';        for(int i = 0;i < n; i++){            r[i+n*2+1] = r[i+n*3+1] = word[n-i-1];        }        r[len] = 0;        da(r,sufix,len+1,328);        calheight(r,sufix,len);        int cnt = 0;        ans[cnt++].p = sufix[len];        for(int i = len-1;i > 1; i--){            if(height[i+1] < n) break;            if(sufix[i]>=n&&sufix[i]<=n*2) continue;            if(sufix[i]>=n*3+1)continue;            ans[cnt++].p = sufix[i];        }        for(int i = 0;i < cnt; i++){            if(ans[i].p > 2*n){                ans[i].c =1;                ans[i].p = n-(ans[i].p-2*n-1);            }            else {                ans[i].p++;                ans[i].c =  0;            }        }        sort(ans,ans+cnt,comp);        printf("%d %d\n",ans[0].p,ans[0].c);    }    return 0;}
                          ^
0_0_20614643_24442.cpp: In function 'void da(int*, int*, int, int)':
0_0_20614643_24442.cpp:5:218: error: 'wwa' was not declared in this scope
     using namespace std;#define maxn 200007int wwa[maxn],wwb[maxn],wwv[maxn],wws[maxn];int cmp(int *r,int a,int b,int l){    return r[a]==r[b]&&r[a+l]==r[b+l];} void da(int *r,int *sufix,int n,int m){    int i,j,p,*x=wwa,*y=wwb,*t;    for(i=0;i<m;i++)wws[i]=0;    for(i=0;i<n;i++)wws[x[i]=r[i]]++;    for(i=1;i<m;i++)wws[i]+=wws[i-1];    for(i=n-1;i>=0;i--)sufix[--wws[x[i]]]=i;    for(j=1,p=1;p<n;j*=2,m=p){        for(p=0,i=n-j;i<n;i++)y[p++]=i;        for(i=0;i<n;i++)            if(sufix[i]>=j)                y[p++]=sufix[i]-j;        for(i=0;i<n;i++)wwv[i]=x[y[i]];        for(i=0;i<m;i++)wws[i]=0;        for(i=0;i<n;i++)wws[wwv[i]]++;        for(i=1;i<m;i++)wws[i]+=wws[i-1];        for(i=n-1;i>=0;i--)            sufix[--wws[wwv[i]]]=y[i];        for(t=x,x=y,y=t,p=1,x[sufix[0]]=0,i=1;i<n;i++)            x[sufix[i]]=cmp(y,sufix[i-1],sufix[i],j)?p-1:p++;     }    return;}int r[maxn];int rank1[maxn],height[maxn],sufix[maxn];void calheight(int *r,int *sufix,int n){    int i,j,k=0;    for(i=0;i<=n;i++) rank1[sufix[i]]=i;    for(i=0;i<n;height[rank1[i++]]=k)        for(k?k--:0,j=sufix[rank1[i]-1];r[i+k]==r[j+k];k++);    return;}struct Node{    int p,c;};int comp(Node a,Node b){    if(a.p == b.p) return a.c < b.c;    return a.p < b.p;} Node ans[maxn]; char word[maxn]; int main(){    int t,n;    scanf("%d",&t);    while(t--){        scanf("%d",&n);        scanf("%s",word);        for(int i = 0;i < n; i++){            r[i]=r[i+n] = word[i];        }        int len =n*4+1;        r[n*2] = '#';        for(int i = 0;i < n; i++){            r[i+n*2+1] = r[i+n*3+1] = word[n-i-1];        }        r[len] = 0;        da(r,sufix,len+1,328);        calheight(r,sufix,len);        int cnt = 0;        ans[cnt++].p = sufix[len];        for(int i = len-1;i > 1; i--){            if(height[i+1] < n) break;            if(sufix[i]>=n&&sufix[i]<=n*2) continue;            if(sufix[i]>=n*3+1)continue;            ans[cnt++].p = sufix[i];        }        for(int i = 0;i < cnt; i++){            if(ans[i].p > 2*n){                ans[i].c =1;                ans[i].p = n-(ans[i].p-2*n-1);            }            else {                ans[i].p++;                ans[i].c =  0;            }        }        sort(ans,ans+cnt,comp);        printf("%d %d\n",ans[0].p,ans[0].c);    }    return 0;}
                                                                                                                                                                                                                          ^
0_0_20614643_24442.cpp:5:252: error: 'wws' was not declared in this scope
     using namespace std;#define maxn 200007int wwa[maxn],wwb[maxn],wwv[maxn],wws[maxn];int cmp(int *r,int a,int b,int l){    return r[a]==r[b]&&r[a+l]==r[b+l];} void da(int *r,int *sufix,int n,int m){    int i,j,p,*x=wwa,*y=wwb,*t;    for(i=0;i<m;i++)wws[i]=0;    for(i=0;i<n;i++)wws[x[i]=r[i]]++;    for(i=1;i<m;i++)wws[i]+=wws[i-1];    for(i=n-1;i>=0;i--)sufix[--wws[x[i]]]=i;    for(j=1,p=1;p<n;j*=2,m=p){        for(p=0,i=n-j;i<n;i++)y[p++]=i;        for(i=0;i<n;i++)            if(sufix[i]>=j)                y[p++]=sufix[i]-j;        for(i=0;i<n;i++)wwv[i]=x[y[i]];        for(i=0;i<m;i++)wws[i]=0;        for(i=0;i<n;i++)wws[wwv[i]]++;        for(i=1;i<m;i++)wws[i]+=wws[i-1];        for(i=n-1;i>=0;i--)            sufix[--wws[wwv[i]]]=y[i];        for(t=x,x=y,y=t,p=1,x[sufix[0]]=0,i=1;i<n;i++)            x[sufix[i]]=cmp(y,sufix[i-1],sufix[i],j)?p-1:p++;     }    return;}int r[maxn];int rank1[maxn],height[maxn],sufix[maxn];void calheight(int *r,int *sufix,int n){    int i,j,k=0;    for(i=0;i<=n;i++) rank1[sufix[i]]=i;    for(i=0;i<n;height[rank1[i++]]=k)        for(k?k--:0,j=sufix[rank1[i]-1];r[i+k]==r[j+k];k++);    return;}struct Node{    int p,c;};int comp(Node a,Node b){    if(a.p == b.p) return a.c < b.c;    return a.p < b.p;} Node ans[maxn]; char word[maxn]; int main(){    int t,n;    scanf("%d",&t);    while(t--){        scanf("%d",&n);        scanf("%s",word);        for(int i = 0;i < n; i++){            r[i]=r[i+n] = word[i];        }        int len =n*4+1;        r[n*2] = '#';        for(int i = 0;i < n; i++){            r[i+n*2+1] = r[i+n*3+1] = word[n-i-1];        }        r[len] = 0;        da(r,sufix,len+1,328);        calheight(r,sufix,len);        int cnt = 0;        ans[cnt++].p = sufix[len];        for(int i = len-1;i > 1; i--){            if(height[i+1] < n) break;            if(sufix[i]>=n&&sufix[i]<=n*2) continue;            if(sufix[i]>=n*3+1)continue;            ans[cnt++].p = sufix[i];        }        for(int i = 0;i < cnt; i++){            if(ans[i].p > 2*n){                ans[i].c =1;                ans[i].p = n-(ans[i].p-2*n-1);            }            else {                ans[i].p++;                ans[i].c =  0;            }        }        sort(ans,ans+cnt,comp);        printf("%d %d\n",ans[0].p,ans[0].c);    }    return 0;}
                                                                                                                                                                                                                                                            ^
0_0_20614643_24442.cpp:5:281: error: 'wws' was not declared in this scope
     using namespace std;#define maxn 200007int wwa[maxn],w


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-16 20:12:50, Gzip enabled