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_20612790_14963.cpp:3:25: error: stray '#' in program
     using namespace std;#define mod 8191const int maxn=5;typedef struct{    int m[maxn][maxn];}Matrix;int N,x,y;void search(){    y=1;    while(1){        x=sqrt(N*y*y+1.0);        if(x*x-N*y*y==1) break;        y++;    }}Matrix per,d;void init(){    d.m[0][0]=x%mod;    d.m[0][1]=y*N%mod;    d.m[1][0]=y%mod;    d.m[1][1]=x%mod;    for(int i=0;i<2;i++)        for(int j=0;j<2;j++)            per.m[i][j]= (i==j);}Matrix Multi(Matrix a,Matrix b){    Matrix c;    for(int i=0;i<2;i++)        for(int j=0;j<2;j++){        c.m[i][j]=0;            for(int k=0;k<2;k++)                c.m[i][j]+=(a.m[i][k]*b.m[k][j])%mod;            c.m[i][j]%=mod;    }    return c;}Matrix power(Matrix a,int k){    Matrix r=per;    while(k)    {        if(k&1) r=Multi(r,a);        a=Multi(a,a);        k>>=1;    }    return r;}int main(){    int k;    while(~scanf("%d%d",&N,&k))    {        int tmp=sqrt(N+0.0);        if(tmp*tmp==N){            printf("No answers can meet such conditions\n");            continue;        }        search();        init();        d=power(d,k-1);        x=(d.m[0][0]*x%mod+d.m[0][1]*y%mod)%mod;        printf("%d\n",x);    }    return 0;}
                         ^
0_0_20612790_14963.cpp:3:26: error: 'define' does not name a type
     using namespace std;#define mod 8191const int maxn=5;typedef struct{    int m[maxn][maxn];}Matrix;int N,x,y;void search(){    y=1;    while(1){        x=sqrt(N*y*y+1.0);        if(x*x-N*y*y==1) break;        y++;    }}Matrix per,d;void init(){    d.m[0][0]=x%mod;    d.m[0][1]=y*N%mod;    d.m[1][0]=y%mod;    d.m[1][1]=x%mod;    for(int i=0;i<2;i++)        for(int j=0;j<2;j++)            per.m[i][j]= (i==j);}Matrix Multi(Matrix a,Matrix b){    Matrix c;    for(int i=0;i<2;i++)        for(int j=0;j<2;j++){        c.m[i][j]=0;            for(int k=0;k<2;k++)                c.m[i][j]+=(a.m[i][k]*b.m[k][j])%mod;            c.m[i][j]%=mod;    }    return c;}Matrix power(Matrix a,int k){    Matrix r=per;    while(k)    {        if(k&1) r=Multi(r,a);        a=Multi(a,a);        k>>=1;    }    return r;}int main(){    int k;    while(~scanf("%d%d",&N,&k))    {        int tmp=sqrt(N+0.0);        if(tmp*tmp==N){            printf("No answers can meet such conditions\n");            continue;        }        search();        init();        d=power(d,k-1);        x=(d.m[0][0]*x%mod+d.m[0][1]*y%mod)%mod;        printf("%d\n",x);    }    return 0;}
                          ^
0_0_20612790_14963.cpp:3:83: error: 'maxn' was not declared in this scope
     using namespace std;#define mod 8191const int maxn=5;typedef struct{    int m[maxn][maxn];}Matrix;int N,x,y;void search(){    y=1;    while(1){        x=sqrt(N*y*y+1.0);        if(x*x-N*y*y==1) break;        y++;    }}Matrix per,d;void init(){    d.m[0][0]=x%mod;    d.m[0][1]=y*N%mod;    d.m[1][0]=y%mod;    d.m[1][1]=x%mod;    for(int i=0;i<2;i++)        for(int j=0;j<2;j++)            per.m[i][j]= (i==j);}Matrix Multi(Matrix a,Matrix b){    Matrix c;    for(int i=0;i<2;i++)        for(int j=0;j<2;j++){        c.m[i][j]=0;            for(int k=0;k<2;k++)                c.m[i][j]+=(a.m[i][k]*b.m[k][j])%mod;            c.m[i][j]%=mod;    }    return c;}Matrix power(Matrix a,int k){    Matrix r=per;    while(k)    {        if(k&1) r=Multi(r,a);        a=Multi(a,a);        k>>=1;    }    return r;}int main(){    int k;    while(~scanf("%d%d",&N,&k))    {        int tmp=sqrt(N+0.0);        if(tmp*tmp==N){            printf("No answers can meet such conditions\n");            continue;        }        search();        init();        d=power(d,k-1);        x=(d.m[0][0]*x%mod+d.m[0][1]*y%mod)%mod;        printf("%d\n",x);    }    return 0;}
                                                                                   ^
0_0_20612790_14963.cpp:3:89: error: 'maxn' was not declared in this scope
     using namespace std;#define mod 8191const int maxn=5;typedef struct{    int m[maxn][maxn];}Matrix;int N,x,y;void search(){    y=1;    while(1){        x=sqrt(N*y*y+1.0);        if(x*x-N*y*y==1) break;        y++;    }}Matrix per,d;void init(){    d.m[0][0]=x%mod;    d.m[0][1]=y*N%mod;    d.m[1][0]=y%mod;    d.m[1][1]=x%mod;    for(int i=0;i<2;i++)        for(int j=0;j<2;j++)            per.m[i][j]= (i==j);}Matrix Multi(Matrix a,Matrix b){    Matrix c;    for(int i=0;i<2;i++)        for(int j=0;j<2;j++){        c.m[i][j]=0;            for(int k=0;k<2;k++)                c.m[i][j]+=(a.m[i][k]*b.m[k][j])%mod;            c.m[i][j]%=mod;    }    return c;}Matrix power(Matrix a,int k){    Matrix r=per;    while(k)    {        if(k&1) r=Multi(r,a);        a=Multi(a,a);        k>>=1;    }    return r;}int main(){    int k;    while(~scanf("%d%d",&N,&k))    {        int tmp=sqrt(N+0.0);        if(tmp*tmp==N){            printf("No answers can meet such conditions\n");            continue;        }        search();        init();        d=power(d,k-1);        x=(d.m[0][0]*x%mod+d.m[0][1]*y%mod)%mod;        printf("%d\n",x);    }    return 0;}
                                                                                         ^
0_0_20612790_14963.cpp: In function 'void init()':
0_0_20612790_14963.cpp:3:254: error: 'struct Matrix' has no member named 'm'
     using namespace std;#define mod 8191const int maxn=5;typedef struct{    int m[maxn][maxn];}Matrix;int N,x,y;void search(){    y=1;    while(1){        x=sqrt(N*y*y+1.0);        if(x*x-N*y*y==1) break;        y++;    }}Matrix per,d;void init(){    d.m[0][0]=x%mod;    d.m[0][1]=y*N%mod;    d.m[1][0]=y%mod;    d.m[1][1]=x%mod;    for(int i=0;i<2;i++)        for(int j=0;j<2;j++)            per.m[i][j]= (i==j);}Matrix Multi(Matrix a,Matrix b){    Matrix c;    for(int i=0;i<2;i++)        for(int j=0;j<2;j++){        c.m[i][j]=0;            for(int k=0;k<2;k++)                c.m[i][j]+=(a.m[i][k]*b.m[k][j])%mod;            c.m[i][j]%=mod;    }    return c;}Matrix power(Matrix a,int k){    Matrix r=per;    while(k)    {        if(k&1) r=Multi(r,a);        a=Multi(a,a);        k>>=1;    }    return r;}int main(){    int k;    while(~scanf("%d%d",&N,&k))    {        int tmp=sqrt(N+0.0);        if(tmp*tmp==N){            printf("No answers can meet such conditions\n");            continue;        }        search();        init();        d=power(d,k-1);        x=(d.m[0][0]*x%mod+d.m[0][1]*y%mod)%mod;        printf("%d\n",x);    }    return 0;}
                                                                                                                                                                                                                                                              ^
0_0_20612790_14963.cpp:3:264: error: 'mod' was not declared in this scope
     using namespace std;#define mod 8191const int maxn=5;typedef struct{    int m[maxn][maxn];}Matrix;int N,x,y;void search(){    y=1;    while(1){        x=sqrt(N*y*y+1.0);        if(x*x-N*y*y==1) break;        y++;    }}Matrix per,d;void init(){    d.m[0][0]=x%mod;    d.m[0][1]=y*N%mod;    d.m[1][0]=y%mod;    d.m[1][1]=x%mod;    for(int i=0;i<2;i++)        for(int j=0;j<2;j++)            per.m[i][j]= (i==j);}Matrix Multi(Matrix a,Matrix b){    Matrix c;    for(int i=0;i<2;i++)        for(int j=0;j<2;j++){        c.m[i][j]=0;            for(int k=0;k<2;k++)                c.m[i][j]+=(a.m[i][k]*b.m[k][j])%mod;            c.m[i][j]%=mod;    }    return c;}Matrix power(Matrix a,int k){    Matrix r=per;    while(k)    {        if(k&1) r=Multi(r,a);        a=Multi(a,a);        k>>=1;    }    return r;}int main(){    int k;    while(~scanf("%d%d",&N,&k))    {        int tmp=sqrt(N+0.0);        if(tmp*tmp==N){            printf("No answers can meet such conditions\n");            continue;        }        search();        init();        d=power(d,k-1);        x=(d.m[0][0]*x%mod+d.m[0][1]*y%mod)%mod;        printf("%d\n",x);    }    return 0;}
                                                                                                                                                                                                                                                                        ^
0_0_20612790_14963.cpp:3:274: error: 'struct Matrix' has no member named 'm'
     using namespace std;#define mod 8191const int maxn=5;typedef struct{    int m[maxn][maxn];}Matrix;int N,x,y;void search(){    y=1;    while(1){        x=sqrt(N*y*y+1.0);        if(x*x-N*y*y==1) break;        y++;    }}Matrix per,d;void init(){    d.m[0][0]=x%mod;    d.m[0][1]=y*N%mod;    d.m[1][0]=y%mod;    d.m[1][1]=x%mod;    for(int i=0;i<2;i++)        for(int j=0;j<2;j++)            per.m[i][j]= (i==j);}Matrix Multi(Matrix a,Matrix b){    Matrix c;    for(int i=0;i<2;i++)        for(int j=0;j<2;j++){        c.m[i][j]=0;            for(int k=0;k<2;k++)                c.m[i][j]+=(a.m[i][k]*b.m[k][j])%mod;            c.m[i][j]%=mod;    }    return c;}Matrix power(Matrix a,int k){    Matrix r=per;    while(k)    {        if(k&1) r=Multi(r,a);        a=Multi(a,a);        k>>=1;    }    return r;}int main(){    int k;    while(~scanf("%d%d",&N,&k))    {        int tmp=sqrt(N+0.0);        if(tmp*tmp==N){            printf("No answers can meet such conditions\n");            continue;        }        search();        init();        d=power(d,k-1);        x=(d.m[0][0]*x%mod+d.m[0][1]*y%mod)%mod;        printf("%d\n",x);    }    return 0;}
                                                                                                                                                                                                                                                                                  ^
0_0_20612790_14963.cpp:3:296: error: 'struct Matrix' has no member named 'm'
     using namespace std;#define mod 8191const int maxn=5;typedef struct{    int m[maxn][maxn];}Matrix;int N,x,y;void search(){    y=1;    while(1){        x=sqrt(N*y*y+1.0);        if(x*x-N*y*y==1) break;        y++;    }}Matrix per,d;void init(){    d.m[0][0]=x%mod;    d.m[0][1]=y*N%mod;    d.m[1][0]=y%mod;    d.m[1][1]=x%mod;    for(int i=0;i<2;i++)        for(int j=0;j<2;j++)            per


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 01:13:38, Gzip enabled