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_20612427_14637.cpp:7:5: error: expected unqualified-id before numeric constant
     1000) p[pos++]=i;            for(int j=(i<<1);j<10005;j+=i)                vd[i]=1;        }    }}void deal(LL k){    len=0;    for(int i=0;i<pos&&k!=1;i++)    {        if(k%p[i]==0)        {            while(k%p[i]==0)            {                d[len++]=p[i];                k/=p[i];            }        }    }}LL exp(LL a,LL b,LL mod){    LL ans=1;    while(b)    {        if(b&1)ans=ans*a%mod;        a=a*a%mod;b>>=1;    }    return ans;}void ex_gcd(LL a,LL b,LL &dd,LL &x,LL &y){    if(b==0)        x=1,y=0,dd=a;    else    {        ex_gcd(b,a%b,dd,y,x);        y-=x*(a/b);    }}LL gauss(LL mod){    bool flag=0;    LL ans=1;    for(int i=0;i<n;i++)        for(int j=0;j<n;j++)            B[i][j]=A[i][j];    for(int k=0;k<n-1;k++)    {        LL max_b=B[k][k];int bin=k;        for(int i=k+1;i<n;i++)            if(B[i][k]>max_b)                max_b=B[i][k],bin=i;        if(bin!=k)        {            for(int i=k;i<n;i++)                swap(B[bin][i],B[k][i]);            flag^=1;        }        if(B[k][k]<0)B[k][k]+=mod;        LL Ni,y,dd;        ex_gcd(B[k][k],mod,dd,Ni,y);        Ni%=mod;        if(Ni<0)Ni+=mod;        for(int j=k+1;j<n;j++)        {            B[k][j]=B[k][j]*Ni%mod;            if(B[k][j]<0)B[k][j]+=mod;            for(int i=k+1;i<n;i++)            {                B[i][j]=(B[i][j]-(B[k][j]*B[i][k])%mod)%mod;                if(B[i][j]<0)B[i][j]+=mod;            }        }        ans*=B[k][k];        ans%=mod;        if(ans<0)ans+=mod;    }    ans*=B[n-1][n-1];    ans%=mod;    if(flag)ans=-ans;    if(ans<0)ans+=mod;    return ans;} LL china_remain(){    LL a,b,c,c1,c2,x,y,dd,N;    a=d[0],c1=r[0];    if(c1==0)c1=d[0];    for(int i=1;i<len;i++)    {        b=d[i],c2=r[i];        ex_gcd(a,b,dd,x,y);        c=c2-c1;        LL b1=b/dd;        x=((c/dd*x)%b1+b1)%b1;        c1=a*x+c1;        a=a*b1;    }    return c1%m;}int main(){    prime();    while(cin>>n>>m)    {        deal(m);        for(int i=0;i<n;i++)            for(int j=0;j<n;j++)                cin>>A[i][j];        if(m==1)        {            cout<<0<<endl;            continue;        }        for(int i=0;i<len;i++)        {            r[i]=gauss(d[i]);        }        cout<<china_remain()<<endl;    }    return 0;}
     ^
0_0_20612427_14637.cpp:7:34: error: expected unqualified-id before 'for'
     1000) p[pos++]=i;            for(int j=(i<<1);j<10005;j+=i)                vd[i]=1;        }    }}void deal(LL k){    len=0;    for(int i=0;i<pos&&k!=1;i++)    {        if(k%p[i]==0)        {            while(k%p[i]==0)            {                d[len++]=p[i];                k/=p[i];            }        }    }}LL exp(LL a,LL b,LL mod){    LL ans=1;    while(b)    {        if(b&1)ans=ans*a%mod;        a=a*a%mod;b>>=1;    }    return ans;}void ex_gcd(LL a,LL b,LL &dd,LL &x,LL &y){    if(b==0)        x=1,y=0,dd=a;    else    {        ex_gcd(b,a%b,dd,y,x);        y-=x*(a/b);    }}LL gauss(LL mod){    bool flag=0;    LL ans=1;    for(int i=0;i<n;i++)        for(int j=0;j<n;j++)            B[i][j]=A[i][j];    for(int k=0;k<n-1;k++)    {        LL max_b=B[k][k];int bin=k;        for(int i=k+1;i<n;i++)            if(B[i][k]>max_b)                max_b=B[i][k],bin=i;        if(bin!=k)        {            for(int i=k;i<n;i++)                swap(B[bin][i],B[k][i]);            flag^=1;        }        if(B[k][k]<0)B[k][k]+=mod;        LL Ni,y,dd;        ex_gcd(B[k][k],mod,dd,Ni,y);        Ni%=mod;        if(Ni<0)Ni+=mod;        for(int j=k+1;j<n;j++)        {            B[k][j]=B[k][j]*Ni%mod;            if(B[k][j]<0)B[k][j]+=mod;            for(int i=k+1;i<n;i++)            {                B[i][j]=(B[i][j]-(B[k][j]*B[i][k])%mod)%mod;                if(B[i][j]<0)B[i][j]+=mod;            }        }        ans*=B[k][k];        ans%=mod;        if(ans<0)ans+=mod;    }    ans*=B[n-1][n-1];    ans%=mod;    if(flag)ans=-ans;    if(ans<0)ans+=mod;    return ans;} LL china_remain(){    LL a,b,c,c1,c2,x,y,dd,N;    a=d[0],c1=r[0];    if(c1==0)c1=d[0];    for(int i=1;i<len;i++)    {        b=d[i],c2=r[i];        ex_gcd(a,b,dd,x,y);        c=c2-c1;        LL b1=b/dd;        x=((c/dd*x)%b1+b1)%b1;        c1=a*x+c1;        a=a*b1;    }    return c1%m;}int main(){    prime();    while(cin>>n>>m)    {        deal(m);        for(int i=0;i<n;i++)            for(int j=0;j<n;j++)                cin>>A[i][j];        if(m==1)        {            cout<<0<<endl;            continue;        }        for(int i=0;i<len;i++)        {            r[i]=gauss(d[i]);        }        cout<<china_remain()<<endl;    }    return 0;}
                                  ^
0_0_20612427_14637.cpp:7:51: error: 'j' does not name a type
     1000) p[pos++]=i;            for(int j=(i<<1);j<10005;j+=i)                vd[i]=1;        }    }}void deal(LL k){    len=0;    for(int i=0;i<pos&&k!=1;i++)    {        if(k%p[i]==0)        {            while(k%p[i]==0)            {                d[len++]=p[i];                k/=p[i];            }        }    }}LL exp(LL a,LL b,LL mod){    LL ans=1;    while(b)    {        if(b&1)ans=ans*a%mod;        a=a*a%mod;b>>=1;    }    return ans;}void ex_gcd(LL a,LL b,LL &dd,LL &x,LL &y){    if(b==0)        x=1,y=0,dd=a;    else    {        ex_gcd(b,a%b,dd,y,x);        y-=x*(a/b);    }}LL gauss(LL mod){    bool flag=0;    LL ans=1;    for(int i=0;i<n;i++)        for(int j=0;j<n;j++)            B[i][j]=A[i][j];    for(int k=0;k<n-1;k++)    {        LL max_b=B[k][k];int bin=k;        for(int i=k+1;i<n;i++)            if(B[i][k]>max_b)                max_b=B[i][k],bin=i;        if(bin!=k)        {            for(int i=k;i<n;i++)                swap(B[bin][i],B[k][i]);            flag^=1;        }        if(B[k][k]<0)B[k][k]+=mod;        LL Ni,y,dd;        ex_gcd(B[k][k],mod,dd,Ni,y);        Ni%=mod;        if(Ni<0)Ni+=mod;        for(int j=k+1;j<n;j++)        {            B[k][j]=B[k][j]*Ni%mod;            if(B[k][j]<0)B[k][j]+=mod;            for(int i=k+1;i<n;i++)            {                B[i][j]=(B[i][j]-(B[k][j]*B[i][k])%mod)%mod;                if(B[i][j]<0)B[i][j]+=mod;            }        }        ans*=B[k][k];        ans%=mod;        if(ans<0)ans+=mod;    }    ans*=B[n-1][n-1];    ans%=mod;    if(flag)ans=-ans;    if(ans<0)ans+=mod;    return ans;} LL china_remain(){    LL a,b,c,c1,c2,x,y,dd,N;    a=d[0],c1=r[0];    if(c1==0)c1=d[0];    for(int i=1;i<len;i++)    {        b=d[i],c2=r[i];        ex_gcd(a,b,dd,x,y);        c=c2-c1;        LL b1=b/dd;        x=((c/dd*x)%b1+b1)%b1;        c1=a*x+c1;        a=a*b1;    }    return c1%m;}int main(){    prime();    while(cin>>n>>m)    {        deal(m);        for(int i=0;i<n;i++)            for(int j=0;j<n;j++)                cin>>A[i][j];        if(m==1)        {            cout<<0<<endl;            continue;        }        for(int i=0;i<len;i++)        {            r[i]=gauss(d[i]);        }        cout<<china_remain()<<endl;    }    return 0;}
                                                   ^
0_0_20612427_14637.cpp:7:59: error: 'j' does not name a type
     1000) p[pos++]=i;            for(int j=(i<<1);j<10005;j+=i)                vd[i]=1;        }    }}void deal(LL k){    len=0;    for(int i=0;i<pos&&k!=1;i++)    {        if(k%p[i]==0)        {            while(k%p[i]==0)            {                d[len++]=p[i];                k/=p[i];            }        }    }}LL exp(LL a,LL b,LL mod){    LL ans=1;    while(b)    {        if(b&1)ans=ans*a%mod;        a=a*a%mod;b>>=1;    }    return ans;}void ex_gcd(LL a,LL b,LL &dd,LL &x,LL &y){    if(b==0)        x=1,y=0,dd=a;    else    {        ex_gcd(b,a%b,dd,y,x);        y-=x*(a/b);    }}LL gauss(LL mod){    bool flag=0;    LL ans=1;    for(int i=0;i<n;i++)        for(int j=0;j<n;j++)            B[i][j]=A[i][j];    for(int k=0;k<n-1;k++)    {        LL max_b=B[k][k];int bin=k;        for(int i=k+1;i<n;i++)            if(B[i][k]>max_b)                max_b=B[i][k],bin=i;        if(bin!=k)        {            for(int i=k;i<n;i++)                swap(B[bin][i],B[k][i]);            flag^=1;        }        if(B[k][k]<0)B[k][k]+=mod;        LL Ni,y,dd;        ex_gcd(B[k][k],mod,dd,Ni,y);        Ni%=mod;        if(Ni<0)Ni+=mod;        for(int j=k+1;j<n;j++)        {            B[k][j]=B[k][j]*Ni%mod;            if(B[k][j]<0)B[k][j]+=mod;            for(int i=k+1;i<n;i++)            {                B[i][j]=(B[i][j]-(B[k][j]*B[i][k])%mod)%mod;                if(B[i][j]<0)B[i][j]+=mod;            }        }        ans*=B[k][k];        ans%=mod;        if(ans<0)ans+=mod;    }    ans*=B[n-1][n-1];    ans%=mod;    if(flag)ans=-ans;    if(ans<0)ans+=mod;    return ans;} LL china_remain(){    LL a,b,c,c1,c2,x,y,dd,N;    a=d[0],c1=r[0];    if(c1==0)c1=d[0];    for(int i=1;i<len;i++)    {        b=d[i],c2=r[i];        ex_gcd(a,b,dd,x,y);        c=c2-c1;        LL b1=b/dd;        x=((c/dd*x)%b1+b1)%b1;        c1=a*x+c1;        a=a*b1;    }    return c1%m;}int main(){    prime();    while(cin>>n>>m)    {        deal(m);        for(int i=0;i<n;i++)            for(int j=0;j<n;j++)                cin>>A[i][j];        if(m==1)        {            cout<<0<<endl;            continue;        }        for(int i=0;i<len;i++)        {            r[i]=gauss(d[i]);        }        cout<<china_remain()<<endl;    }    return 0;}
                                                           ^
0_0_20612427_14637.cpp:7:96: error: expected declaration before '}' token
     1000) p[pos++]=i;            for(int j=(i<<1);j<10005;j+=i)                vd[i]=1;        }    }}void deal(LL k){    len=0;    for(int i=0;i<pos&&k!=1;i++)    {        if(k%p[i]==0)        {            while(k%p[i]==0)            {                d[len++]=p[i];                k/=p[i];            }        }    }}LL exp(LL a,LL b,LL mod){    LL ans=1;    while(b)    {        if(b&1)ans=ans*a%mod;        a=a*a%mod;b>>=1;    }    return ans;}void ex_gcd(LL a,LL b,LL &dd,LL &x,LL &y){    if(b==0)        x=1,y=0,dd=a;    else    {        ex_gcd(b,a%b,dd,y,x);        y-=x*(a/b);    }}LL gauss(LL mod){    bool flag=0;    LL ans=1;    for(int i=0;i<n;i++)        for(int j=0;j<n;j++)            B[i][j]=A[i][j];    for(int k=0;k<n-1;k++)    


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-23 07:58:44, Gzip enabled