/ Vijos /

记录详情

Wrong Answer

foo.cc: In function 'int main()':
foo.cc:4:25: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'll*' {aka 'long long int*'} [-Wformat=]
    4 | #define GetI64(x) scanf("%I64d",&x)
      |                         ^~~~~~~ ~~~
      |                                 |
      |                                 ll* {aka long long int*}
    5 | #define PutI64(x,arg...) printf("%I64d" arg,x)
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    6 | 
      |                          
    7 | ll mod;
      | ~~~~~~~                  
    8 | 
      |                          
    9 | ll mul(ll a,ll b){
      | ~~~~~~~~~~~~~~~~~~       
   10 |     ll ans=0;
      |     ~~~~~~~~~            
   11 |     while(b){
      |     ~~~~~~~~~            
   12 |         if(b&1)ans=(ans+a)%mod;
      |         ~~~~~~~~~~~~~~~~~~~~~~~
   13 |         a=(a+a)%mod;
      |         ~~~~~~~~~~~~     
   14 |         b>>=1;
      |         ~~~~~~           
   15 |     }
      |     ~                    
   16 |     return ans;
      |     ~~~~~~~~~~~          
   17 | }
      | ~                        
   18 | 
      |                          
   19 | 
      |                          
   20 | 
      |                          
   21 | struct mat{
      | ~~~~~~~~~~~              
   22 |     int m,n;
      |     ~~~~~~~~             
   23 |     ll a[3][3];
      |     ~~~~~~~~~~~          
   24 |     mat(int M=0,int N=0){m=M;n=N;}
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   25 |     void clear(){
      |     ~~~~~~~~~~~~~        
   26 |         for(int i=1;i<=m;++i){
      |         ~~~~~~~~~~~~~~~~~~~~~~
   27 |             for(int j=1;j<=n;++j){
      |             ~~~~~~~~~~~~~~~~~~~~~~
   28 |                 a[i][j]=0;
      |                 ~~~~~~~~~~
   29 |             }
      |             ~            
   30 |         }
      |         ~                
   31 |     }
      |     ~                    
   32 |     ll*operator[](int d){return a[d];}
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   33 | };
      | ~~                       
   34 | 
      |                          
   35 | mat operator*(mat a,mat b){
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
   36 |     mat c(a.m,b.n);
      |     ~~~~~~~~~~~~~~~      
   37 |     //a.n==b.m
      |     ~~~~~~~~~~           
   38 |     c.clear();
      |     ~~~~~~~~~~           
   39 |     for(int k=1;k<=a.n;++k){
      |     ~~~~~~~~~~~~~~~~~~~~~~~~
   40 |         for(int i=1;i<=a.m;++i){
      |         ~~~~~~~~~~~~~~~~~~~~~~~~
   41 |             for(int j=1;j<=b.n;++j){
      |             ~~~~~~~~~~~~~~~~~~~~~~~~
   42 |                 c[i][j]+=mul(a[i][k],b[k][j]);
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   43 |                 c[i][j]%=mod;
      |                 ~~~~~~~~~~~~~
   44 |                 if(c[i][j]<0)c[i][j]+=mod;
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~
   45 |             }
      |             ~            
   46 |         }
      |         ~                
   47 |     }
      |     ~                    
   48 |     return c;
      |     ~~~~~~~~~            
   49 | }
      | ~                        
   50 | 
      |                          
   51 | mat operator^(mat x,ll p){
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~
   52 |     if(p==1)return x;
      |     ~~~~~~~~~~~~~~~~~    
   53 |     if(p==2)return x*x;
      |     ~~~~~~~~~~~~~~~~~~~  
   54 |     mat t=x^(p/2);
      |     ~~~~~~~~~~~~~~       
   55 |     t=t*t;
      |     ~~~~~~               
   56 |     if(p&1)t=t*x;
      |     ~~~~~~~~~~~~~        
   57 |     return t;
      |     ~~~~~~~~~            
   58 | }
      | ~                        
   59 | 
      |                          
   60 | 
      |                          
   61 | int main(){
      | ~~~~~~~~~~~              
   62 |     ll m,a,c,x0,n,g;
      |     ~~~~~~~~~~~~~~~~     
   63 |     GetI64(m);GetI64(a);GetI64(c);GetI64(x0);GetI64(n);GetI64(g);
      |     ~~~~~~~~             
foo.cc:63:5: note: in expansion of macro 'GetI64'
   63 |     GetI64(m);GetI64(a);GetI64(c);GetI64(x0);GetI64(n);GetI64(g);
      |     ^~~~~~
foo.cc:4:30: note: format string is defined here
    4 | #define GetI64(x) scanf("%I64d",&x)
      |                          ~~~~^
      |                              |
      |                              int*
      |                          %I64lld
foo.cc:4:25: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'll*' {aka 'long long int*'} [-Wformat=]
    4 | #define GetI64(x) scanf("%I64d",&x)
      |                         ^~~~~~~ ~~~
      |                                 |
      |                                 ll* {aka long long int*}
    5 | #define PutI64(x,arg...) printf("%I64d" arg,x)
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    6 | 
      |                          
    7 | ll mod;
      | ~~~~~~~                  
    8 | 
      |                          
    9 | ll mul(ll a,ll b){
      | ~~~~~~~~~~~~~~~~~~       
   10 |     ll ans=0;
      |     ~~~~~~~~~            
   11 |     while(b){
      |     ~~~~~~~~~            
   12 |         if(b&1)ans=(ans+a)%mod;
      |         ~~~~~~~~~~~~~~~~~~~~~~~
   13 |         a=(a+a)%mod;
      |         ~~~~~~~~~~~~     
   14 |         b>>=1;
      |         ~~~~~~           
   15 |     }
      |     ~                    
   16 |     return ans;
      |     ~~~~~~~~~~~          
   17 | }
      | ~                        
   18 | 
      |                          
   19 | 
      |                          
   20 | 
      |                          
   21 | struct mat{
      | ~~~~~~~~~~~              
   22 |     int m,n;
      |     ~~~~~~~~             
   23 |     ll a[3][3];
      |     ~~~~~~~~~~~          
   24 |     mat(int M=0,int N=0){m=M;n=N;}
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   25 |     void clear(){
      |     ~~~~~~~~~~~~~        
   26 |         for(int i=1;i<=m;++i){
      |         ~~~~~~~~~~~~~~~~~~~~~~
   27 |             for(int j=1;j<=n;++j){
      |             ~~~~~~~~~~~~~~~~~~~~~~
   28 |                 a[i][j]=0;
      |                 ~~~~~~~~~~
   29 |             }
      |             ~            
   30 |         }
      |         ~                
   31 |     }
      |     ~                    
   32 |     ll*operator[](int d){return a[d];}
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   33 | };
      | ~~                       
   34 | 
      |                          
   35 | mat operator*(mat a,mat b){
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
   36 |     mat c(a.m,b.n);
      |     ~~~~~~~~~~~~~~~      
   37 |     //a.n==b.m
      |     ~~~~~~~~~~           
   38 |     c.clear();
      |     ~~~~~~~~~~           
   39 |     for(int k=1;k<=a.n;++k){
      |     ~~~~~~~~~~~~~~~~~~~~~~~~
   40 |         for(int i=1;i<=a.m;++i){
      |         ~~~~~~~~~~~~~~~~~~~~~~~~
   41 |             for(int j=1;j<=b.n;++j){
      |             ~~~~~~~~~~~~~~~~~~~~~~~~
   42 |                 c[i][j]+=mul(a[i][k],b[k][j]);
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   43 |                 c[i][j]%=mod;
      |                 ~~~~~~~~~~~~~
   44 |                 if(c[i][j]<0)c[i][j]+=mod;
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~
   45 |             }
      |             ~            
   46 |         }
      |         ~                
   47 |     }
      |     ~                    
   48 |     return c;
      |     ~~~~~~~~~            
   49 | }
      | ~                        
   50 | 
      |                          
   51 | mat operator^(mat x,ll p){
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~
   52 |     if(p==1)return x;
      |     ~~~~~~~~~~~~~~~~~    
   53 |     if(p==2)return x*x;
      |     ~~~~~~~~~~~~~~~~~~~  
   54 |     mat t=x^(p/2);
      |     ~~~~~~~~~~~~~~       
   55 |     t=t*t;
      |     ~~~~~~               
   56 |     if(p&1)t=t*x;
      |     ~~~~~~~~~~~~~        
   57 |     return t;
      |     ~~~~~~~~~            
   58 | }
      | ~                        
   59 | 
      |                          
   60 | 
      |                          
   61 | int main(){
      | ~~~~~~~~~~~              
   62 |     ll m,a,c,x0,n,g;
      |     ~~~~~~~~~~~~~~~~     
   63 |     GetI64(m);GetI64(a);GetI64(c);GetI64(x0);GetI64(n);GetI64(g);
      |     ~~~~~~~~~~~~~~~~~~   
foo.cc:63:15: note: in expansion of macro 'GetI64'
   63 |     GetI64(m);GetI64(a);GetI64(c);GetI64(x0);GetI64(n);GetI64(g);
      |               ^~~~~~
foo.cc:4:30: note: format string is defined here
    4 | #define GetI64(x) scanf("%I64d",&x)
      |                          ~~~~^
      |                              |
      |                              int*
      |                          %I64lld
foo.cc:4:25: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'll*' {aka 'long long int*'} [-Wformat=]
    4 | #define GetI64(x) scanf("%I64d",&x)
      |                         ^~~~~~~ ~~~
      |                                 |
      |                                 ll* {aka long long int*}
    5 | #define PutI64(x,arg...) printf("%I64d" arg,x)
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    6 | 
      |                          
    7 | ll mod;
      | ~~~~~~~                  
    8 | 
      |                          
    9 | ll mul(ll a,ll b){
      | ~~~~~~~~~~~~~~~~~~       
   10 |     ll ans=0;
      |     ~~~~~~~~~            
   11 |     while(b){
      |     ~~~~~~~~~            
   12 |         if(b&1)ans=(ans+a)%mod;
      |         ~~~~~~~~~~~~~~~~~~~~~~~
   13 |         a=(a+a)%mod;
      |         ~~~~~~~~~~~~     
   14 |         b>>=1;
      |         ~~~~~~           
   15 |     }
      |     ~                    
   16 |     return ans;
      |     ~~~~~~~~~~~          
   17 | }
      | ~                        
   18 | 
      |                          
   19 | 
      |                          
   20 | 
      |                          
   21 | struct mat{
      | ~~~~~~~~~~~              
   22 |     int m,n;
      |     ~~~~~~~~             
   23 |     ll a[3][3];
      |     ~~~~~~~~~~~          
   24 |     mat(int M=0,int N=0){m=M;n=N;}
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   25 |     void clear(){
      |     ~~~~~~~~~~~~~        
   26 |         for(int i=1;i<=m;++i){
      |         ~~~~~~~~~~~~~~~~~~~~~~
   27 |             for(int j=1;j<=n;++j){
      |             ~~~~~~~~~~~~~~~~~~~~~~
   28 |                 a[i][j]=0;
      |                 ~~~~~~~~~~
   29 |             }
      |             ~            
   30 |         }
      |         ~                
   31 |     }
      |     ~                    
   32 |     ll*operator[](int d){return a[d];}
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   33 | };
      | ~~                       
   34 | 
      |                          
   35 | mat operator*(mat a,mat b){
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
   36 |     mat c(a.m,b.n);
      |     ~~~~~~~~~~~~~~~      
   37 |     //a.n==b.m
      |     ~~~~~~~~~~           
   38 |     c.clear();
      |     ~~~~~~~~~~           
   39 |     for(int k=1;k<=a.n;++k){
      |     ~~~~~~~~~~~~~~~~~~~~~~~~
   40 |         for(int i=1;i<=a.m;++i){
      |         ~~~~~~~~~~~~~~~~~~~~~~~~
   41 |             for(int j=1;j<=b.n;++j){
      |             ~~~~~~~~~~~~~~~~~~~~~~~~
   42 |                 c[i][j]+=mul(a[i][k],b[k][j]);
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   43 |                 c[i][j]%=mod;
      |                 ~~~~~~~~~~~~~
   44 |                 if(c[i][j]<0)c[i][j]+=mod;
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~
   45 |             }
      |             ~            
   46 |         }
      |         ~                
   47 |     }
      |     ~                    
   48 |     return c;
      |     ~~~~~~~~~            
   49 | }
      | ~                        
   50 | 
      |                          
   51 | mat operator^(mat x,ll p){
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~
   52 |     if(p==1)return x;
      |     ~~~~~~~~~~~~~~~~~    
   53 |     if(p==2)return x*x;
      |     ~~~~~~~~~~~~~~~~~~~  
   54 |     mat t=x^(p/2);
      |     ~~~~~~~~~~~~~~       
   55 |     t=t*t;
      |     ~~~~~~               
   56 |     if(p&1)t=t*x;
      |     ~~~~~~~~~~~~~        
   57 |     return t;
      |     ~~~~~~~~~            
   58 | }
      | ~                        
   59 | 
      |                          
   60 | 
      |                          
   61 | int main(){
      | ~~~~~~~~~~~              
   62 |     ll m,a,c,x0,n,g;
      |     ~~~~~~~~~~~~~~~~     
   63 |     GetI64(m);GetI64(a);GetI64(c);GetI64(x0);GetI64(n);GetI64(g);
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
foo.cc:63:25: note: in expansion of macro 'GetI64'
   63 |     GetI64(m);GetI64(a);GetI64(c);GetI64(x0);GetI64(n);GetI64(g);
      |                         ^~~~~~
foo.cc:4:30: note: format string is defined here
    4 | #define GetI64(x) scanf("%I64d",&x)
      |                          ~~~~^
      |                              |
      |                              int*
      |                          %I64lld
foo.cc:4:25: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'll*' {aka 'long long int*'} [-Wformat=]
    4 | #define GetI64(x) scanf("%I64d",&x)
      |                         ^~~~~~~ ~~~
      |                                 |
      |                                 ll* {aka long long int*}
    5 | #define PutI64(x,arg...) printf("%I64d" arg,x)
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    6 | 
      |                          
    7 | ll mod;
      | ~~~~~~~                  
    8 | 
      |                          
    9 | ll mul(ll a,ll b){
      | ~~~~~~~~~~~~~~~~~~       
   10 |     ll ans=0;
      |     ~~~~~~~~~            
   11 |     while(b){
      |     ~~~~~~~~~            
   12 |         if(b&1)ans=(ans+a)%mod;
      |         ~~~~~~~~~~~~~~~~~~~~~~~
   13 |         a=(a+a)%mod;
      |         ~~~~~~~~~~~~     
   14 |         b>>=1;
      |         ~~~~~~           
   15 |     }
      |     ~                    
   16 |     return ans;
      |     ~~~~~~~~~~~          
   17 | }
      | ~                        
   18 | 
      |                          
   19 | 
      |                          
   20 | 
      |                          
   21 | struct mat{
      | ~~~~~~~~~~~              
   22 |     int m,n;
      |     ~~~~~~~~             
   23 |     ll a[3][3];
      |     ~~~~~~~~~~~          
   24 |     mat(int M=0,int N=0){m=M;n=N;}
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   25 |     void clear(){
      |     ~~~~~~~~~~~~~        
   26 |         for(int i=1;i<=m;++i){
      |         ~~~~~~~~~~~~~~~~~~~~~~
   27 |             for(int j=1;j<=n;++j){
      |             ~~~~~~~~~~~~~~~~~~~~~~
   28 |                 a[i][j]=0;
      |                 ~~~~~~~~~~
   29 |             }
      |             ~            
   30 |         }
      |         ~                
   31 |     }
      |     ~                    
   32 |     ll*operator[](int d){return a[d];}
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   33 | };
      | ~~                       
   34 | 
      |                          
   35 | mat operator*(mat a,mat b){
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
   36 |     mat c(a.m,b.n);
      |     ~~~~~~~~~~~~~~~      
   37 |     //a.n==b.m
      |     ~~~~~~~~~~           
   38 |     c.clear();
      |     ~~~~~~~~~~           
   39 |     for(int k=1;k<=a.n;++k){
      |     ~~~~~~~~~~~~~~~~~~~~~~~~
   40 |         for(int i=1;i<=a.m;++i){
      |         ~~~~~~~~~~~~~~~~~~~~~~~~
   41 |             for(int j=1;j<=b.n;++j){
      |             ~~~~~~~~~~~~~~~~~~~~~~~~
   42 |                 c[i][j]+=mul(a[i][k],b[k][j]);
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   43 |                 c[i][j]%=mod;
      |                 ~~~~~~~~~~~~~
   44 |                 if(c[i][j]<0)c[i][j]+=mod;
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~
   45 |             }
      |             ~            
   46 |         }
      |         ~                
   47 |     }
      |     ~                    
   48 |     return c;
      |     ~~~~~~~~~            
   49 | }
      | ~                        
   50 | 
      |                          
   51 | mat operator^(mat x,ll p){
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~
   52 |     if(p==1)return x;
      |     ~~~~~~~~~~~~~~~~~    
   53 |     if(p==2)return x*x;
      |     ~~~~~~~~~~~~~~~~~~~  
   54 |     mat t=x^(p/2);
      |     ~~~~~~~~~~~~~~       
   55 |     t=t*t;
      |     ~~~~~~               
   56 |     if(p&1)t=t*x;
      |     ~~~~~~~~~~~~~        
   57 |     return t;
      |     ~~~~~~~~~            
   58 | }
      | ~                        
   59 | 
      |                          
   60 | 
      |                          
   61 | int main(){
      | ~~~~~~~~~~~              
   62 |     ll m,a,c,x0,n,g;
      |     ~~~~~~~~~~~~~~~~     
   63 |     GetI64(m);GetI64(a);GetI64(c);GetI64(x0);GetI64(n);GetI64(g);
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
foo.cc:63:35: note: in expansion of macro 'GetI64'
   63 |     GetI64(m);GetI64(a);GetI64(c);GetI64(x0);GetI64(n);GetI64(g);
      |                                   ^~~~~~
foo.cc:4:30: note: format string is defined here
    4 | #define GetI64(x) scanf("%I64d",&x)
      |                          ~~~~^
      |                              |
      |                              int*
      |                          %I64lld
foo.cc:4:25: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'll*' {aka 'long long int*'} [-Wformat=]
    4 | #define GetI64(x) scanf("%I64d",&x)
      |                         ^~~~~~~ ~~~
      |                                 |
      |                                 ll* {aka long long int*}
    5 | #define PutI64(x,arg...) printf("%I64d" arg,x)
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    6 | 
      |                          
    7 | ll mod;
      | ~~~~~~~                  
    8 | 
      |                          
    9 | ll mul(ll a,ll b){
      | ~~~~~~~~~~~~~~~~~~       
   10 |     ll ans=0;
      |     ~~~~~~~~~            
   11 |     while(b){
      |     ~~~~~~~~~            
   12 |         if(b&1)ans=(ans+a)%mod;
      |         ~~~~~~~~~~~~~~~~~~~~~~~
   13 |         a=(a+a)%mod;
      |         ~~~~~~~~~~~~     
   14 |         b>>=1;
      |         ~~~~~~           
   15 |     }
      |     ~                    
   16 |     return ans;
      |     ~~~~~~~~~~~          
   17 | }
      | ~                        
   18 | 
      |                          
   19 | 
      |                          
   20 | 
      |                          
   21 | struct mat{
      | ~~~~~~~~~~~              
   22 |     int m,n;
      |     ~~~~~~~~             
   23 |     ll a[3][3];
      |     ~~~~~~~~~~~          
   24 |     mat(int M=0,int N=0){m=M;n=N;}
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   25 |     void clear(){
      |     ~~~~~~~~~~~~~        
   26 |         for(int i=1;i<=m;++i){
      |         ~~~~~~~~~~~~~~~~~~~~~~
   27 |             for(int j=1;j<=n;++j){
      |             ~~~~~~~~~~~~~~~~~~~~~~
   28 |                 a[i][j]=0;
      |                 ~~~~~~~~~~
   29 |             }
      |             ~            
   30 |         }
      |         ~                
   31 |     }
      |     ~                    
   32 |     ll*operator[](int d){return a[d];}
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   33 | };
      | ~~                       
   34 | 
      |                          
   35 | mat operator*(mat a,mat b){
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
   36 |     mat c(a.m,b.n);
      |     ~~~~~~~~~~~~~~~      
   37 |     //a.n==b.m
      |     ~~~~~~~~~~           
   38 |     c.clear();
      |     ~~~~~~~~~~           
   39 |     for(int k=1;k<=a.n;++k){
      |     ~~~~~~~~~~~~~~~~~~~~~~~~
   40 |         for(int i=1;i<=a.m;++i){
      |         ~~~~~~~~~~~~~~~~~~~~~~~~
   41 |             for(int j=1;j<=b.n;++j){
      |             ~~~~~~~~~~~~~~~~~~~~~~~~
   42 |                 c[i][j]+=mul(a[i][k],b[k][j]);
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   43 |                 c[i][j]%=mod;
      |                 ~~~~~~~~~~~~~
   44 |                 if(c[i][j]<0)c[i][j]+=mod;
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~
   45 |             }
      |             ~            
   46 |         }
      |         ~                
   47 |     }
      |     ~                    
   48 |     return c;
      |     ~~~~~~~~~            
   49 | }
      | ~                        
   50 | 
      |                          
   51 | mat operator^(mat x,ll p){
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~
   52 |     if(p==1)return x;
      |     ~~~~~~~~~~~~~~~~~    
   53 |     if(p==2)return x*x;
      |     ~~~~~~~~~~~~~~~~~~~  
   54 |     mat t=x^(p/2);
      |     ~~~~~~~~~~~~~~       
   55 |     t=t*t;
      |     ~~~~~~               
   56 |     if(p&1)t=t*x;
      |     ~~~~~~~~~~~~~        
   57 |     return t;
      |     ~~~~~~~~~            
   58 | }
      | ~                        
   59 | 
      |                          
   60 | 
      |                          
   61 | int main(){
      | ~~~~~~~~~~~              
   62 |     ll m,a,c,x0,n,g;
      |     ~~~~~~~~~~~~~~~~     
   63 |     GetI64(m);GetI64(a);GetI64(c);GetI64(x0);GetI64(n);GetI64(g);
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
foo.cc:63:46: note: in expansion of macro 'GetI64'
   63 |     GetI64(m);GetI64(a);GetI64(c);GetI64(x0);GetI64(n);GetI64(g);
      |                                              ^~~~~~
foo.cc:4:30: note: format string is defined here
    4 | #define GetI64(x) scanf("%I64d",&x)
      |                          ~~~~^
      |                              |
      |                              int*
      |                          %I64lld
foo.cc:4:25: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'll*' {aka 'long long int*'} [-Wformat=]
    4 | #define GetI64(x) scanf("%I64d",&x)
      |                         ^~~~~~~ ~~~
      |                                 |
      |                                 ll* {aka long long int*}
    5 | #define PutI64(x,arg...) printf("%I64d" arg,x)
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    6 | 
      |                          
    7 | ll mod;
      | ~~~~~~~                  
    8 | 
      |                          
    9 | ll mul(ll a,ll b){
      | ~~~~~~~~~~~~~~~~~~       
   10 |     ll ans=0;
      |     ~~~~~~~~~            
   11 |     while(b){
      |     ~~~~~~~~~            
   12 |         if(b&1)ans=(ans+a)%mod;
      |         ~~~~~~~~~~~~~~~~~~~~~~~
   13 |         a=(a+a)%mod;
      |         ~~~~~~~~~~~~     
   14 |         b>>=1;
      |         ~~~~~~           
   15 |     }
      |     ~                    
   16 |     return ans;
      |     ~~~~~~~~~~~          
   17 | }
      | ~                        
   18 | 
      |                          
   19 | 
      |                          
   20 | 
      |                          
   21 | struct mat{
      | ~~~~~~~~~~~              
   22 |     int m,n;
      |     ~~~~~~~~             
   23 |     ll a[3][3];
      |     ~~~~~~~~~~~          
   24 |     mat(int M=0,int N=0){m=M;n=N;}
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   25 |     void clear(){
      |     ~~~~~~~~~~~~~        
   26 |         for(int i=1;i<=m;++i){
      |         ~~~~~~~~~~~~~~~~~~~~~~
   27 |             for(int j=1;j<=n;++j){
      |             ~~~~~~~~~~~~~~~~~~~~~~
   28 |                 a[i][j]=0;
      |                 ~~~~~~~~~~
   29 |             }
      |             ~            
   30 |         }
      |         ~                
   31 |     }
      |     ~                    
   32 |     ll*operator[](int d){return a[d];}
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   33 | };
      | ~~                       
   34 | 
      |                          
   35 | mat operator*(mat a,mat b){
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
   36 |     mat c(a.m,b.n);
      |     ~~~~~~~~~~~~~~~      
   37 |     //a.n==b.m
      |     ~~~~~~~~~~           
   38 |     c.clear();
      |     ~~~~~~~~~~           
   39 |     for(int k=1;k<=a.n;++k){
      |     ~~~~~~~~~~~~~~~~~~~~~~~~
   40 |         for(int i=1;i<=a.m;++i){
      |         ~~~~~~~~~~~~~~~~~~~~~~~~
   41 |             for(int j=1;j<=b.n;++j){
      |             ~~~~~~~~~~~~~~~~~~~~~~~~
   42 |                 c[i][j]+=mul(a[i][k],b[k][j]);
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   43 |                 c[i][j]%=mod;
      |                 ~~~~~~~~~~~~~
   44 |                 if(c[i][j]<0)c[i][j]+=mod;
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~
   45 |             }
      |             ~            
   46 |         }
      |         ~                
   47 |     }
      |     ~                    
   48 |     return c;
      |     ~~~~~~~~~            
   49 | }
      | ~                        
   50 | 
      |                          
   51 | mat operator^(mat x,ll p){
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~
   52 |     if(p==1)return x;
      |     ~~~~~~~~~~~~~~~~~    
   53 |     if(p==2)return x*x;
      |     ~~~~~~~~~~~~~~~~~~~  
   54 |     mat t=x^(p/2);
      |     ~~~~~~~~~~~~~~       
   55 |     t=t*t;
      |     ~~~~~~               
   56 |     if(p&1)t=t*x;
      |     ~~~~~~~~~~~~~        
   57 |     return t;
      |     ~~~~~~~~~            
   58 | }
      | ~                        
   59 | 
      |                          
   60 | 
      |                          
   61 | int main(){
      | ~~~~~~~~~~~              
   62 |     ll m,a,c,x0,n,g;
      |     ~~~~~~~~~~~~~~~~     
   63 |     GetI64(m);GetI64(a);GetI64(c);GetI64(x0);GetI64(n);GetI64(g);
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
foo.cc:63:56: note: in expansion of macro 'GetI64'
   63 |     GetI64(m);GetI64(a);GetI64(c);GetI64(x0);GetI64(n);GetI64(g);
      |                                                        ^~~~~~
foo.cc:4:30: note: format string is defined here
    4 | #define GetI64(x) scanf("%I64d",&x)
      |                          ~~~~^
      |                              |
      |                              int*
      |                          %I64lld
foo.cc:5:33: warning: format '%d' expects argument of type 'int', but argument 2 has type 'll' {aka 'long long int'} [-Wformat=]
    5 | #define PutI64(x,arg...) printf("%I64d" arg,x)
      |                                 ^~~~~~~~~~~~~~
    6 | 
      |                                  
    7 | ll mod;
      | ~~~~~~~                          
    8 | 
      |                                  
    9 | ll mul(ll a,ll b){
      | ~~~~~~~~~~~~~~~~~~               
   10 |     ll ans=0;
      |     ~~~~~~~~~                    
   11 |     while(b){
      |     ~~~~~~~~~                    
   12 |         if(b&1)ans=(ans+a)%mod;
      |         ~~~~~~~~~~~~~~~~~~~~~~~  
   13 |         a=(a+a)%mod;
      |         ~~~~~~~~~~~~             
   14 |         b>>=1;
      |         ~~~~~~                   
   15 |     }
      |     ~                            
   16 |     return ans;
      |     ~~~~~~~~~~~                  
   17 | }
      | ~                                
   18 | 
      |                                  
   19 | 
      |                                  
   20 | 
      |                                  
   21 | struct mat{
      | ~~~~~~~~~~~                      
   22 |     int m,n;
      |     ~~~~~~~~                     
   23 |     ll a[3][3];
      |     ~~~~~~~~~~~                  
   24 |     mat(int M=0,int N=0){m=M;n=N;}
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   25 |     void clear(){
      |     ~~~~~~~~~~~~~                
   26 |         for(int i=1;i<=m;++i){
      |         ~~~~~~~~~~~~~~~~~~~~~~   
   27 |             for(int j=1;j<=n;++j){
      |             ~~~~~~~~~~~~~~~~~~~~~~
   28 |                 a[i][j]=0;
      |                 ~~~~~~~~~~       
   29 |             }
      |             ~                    
   30 |         }
      |         ~                        
   31 |     }
      |     ~                            
   32 |     ll*operator[](int d){return a[d];}
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   33 | };
      | ~~                               
   34 | 
      |                                  
   35 | mat operator*(mat a,mat b){
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~      
   36 |     mat c(a.m,b.n);
      |     ~~~~~~~~~~~~~~~              
   37 |     //a.n==b.m
      |     ~~~~~~~~~~                   
   38 |     c.clear();
      |     ~~~~~~~~~~                   
   39 |     for(int k=1;k<=a.n;++k){
      |     ~~~~~~~~~~~~~~~~~~~~~~~~     
   40 |         for(int i=1;i<=a.m;++i){
      |         ~~~~~~~~~~~~~~~~~~~~~~~~ 
   41 |             for(int j=1;j<=b.n;++j){
      |             ~~~~~~~~~~~~~~~~~~~~~~~~
   42 |                 c[i][j]+=mul(a[i][k],b[k][j]);
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   43 |                 c[i][j]%=mod;
      |                 ~~~~~~~~~~~~~    
   44 |                 if(c[i][j]<0)c[i][j]+=mod;
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~
   45 |             }
      |             ~                    
   46 |         }
      |         ~                        
   47 |     }
      |     ~                            
   48 |     return c;
      |     ~~~~~~~~~                    
   49 | }
      | ~                                
   50 | 
      |                                  
   51 | mat operator^(mat x,ll p){
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~       
   52 |     if(p==1)return x;
      |     ~~~~~~~~~~~~~~~~~            
   53 |     if(p==2)return x*x;
      |     ~~~~~~~~~~~~~~~~~~~          
   54 |     mat t=x^(p/2);
      |     ~~~~~~~~~~~~~~               
   55 |     t=t*t;
      |     ~~~~~~                       
   56 |     if(p&1)t=t*x;
      |     ~~~~~~~~~~~~~                
   57 |     return t;
      |     ~~~~~~~~~                    
   58 | }
      | ~                                
   59 | 
      |                                  
   60 | 
      |                                  
   61 | int main(){
      | ~~~~~~~~~~~                      
   62 |     ll m,a,c,x0,n,g;
      |     ~~~~~~~~~~~~~~~~             
   63 |     GetI64(m);GetI64(a);GetI64(c);GetI64(x0);GetI64(n);GetI64(g);
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   64 |     mod=m;
      |     ~~~~~~                       
   65 |     mat b(1,2);
      |     ~~~~~~~~~~~                  
   66 |     b[1][1]=x0;
      |     ~~~~~~~~~~~                  
   67 |     b[1][2]=c;
      |     ~~~~~~~~~~                   
   68 |     mat f(2,2);
      |     ~~~~~~~~~~~                  
   69 |     f[1][1]=a;
      |     ~~~~~~~~~~                   
   70 |     f[1][2]=0;
      |     ~~~~~~~~~~                   
   71 |     f[2][1]=1;
      |     ~~~~~~~~~~                   
   72 |     f[2][2]=1;
      |     ~~~~~~~~~~                   
   73 |     mat ans=b*(f^n);
      |     ~~~~~~~~~~~~~~~~             
   74 |     ll x=ans[1][1]%g;
      |     ~~~~~~~~~~~~~~~~~            
   75 |     if(x<0)x+=g;
      |     ~~~~~~~~~~~~                 
   76 |     PutI64(x,"\n");
      |     ~~~~~~~~~~~~~                
      |            |
      |            ll {aka long long int}
foo.cc:76:5: note: in expansion of macro 'PutI64'
   76 |     PutI64(x,"\n");
      |     ^~~~~~
foo.cc:5:38: note: format string is defined here
    5 | #define PutI64(x,arg...) printf("%I64d" arg,x)
      |                                  ~~~~^
      |                                      |
      |                                      int
      |                                  %I64lld
foo.cc:4:24: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
    4 | #define GetI64(x) scanf("%I64d",&x)
      |                   ~~~~~^~~~~~~~~~~~
foo.cc:63:5: note: in expansion of macro 'GetI64'
   63 |     GetI64(m);GetI64(a);GetI64(c);GetI64(x0);GetI64(n);GetI64(g);
      |     ^~~~~~
foo.cc:4:24: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
    4 | #define GetI64(x) scanf("%I64d",&x)
      |                   ~~~~~^~~~~~~~~~~~
foo.cc:63:15: note: in expansion of macro 'GetI64'
   63 |     GetI64(m);GetI64(a);GetI64(c);GetI64(x0);GetI64(n);GetI64(g);
      |               ^~~~~~
foo.cc:4:24: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
    4 | #define GetI64(x) scanf("%I64d",&x)
      |                   ~~~~~^~~~~~~~~~~~
foo.cc:63:25: note: in expansion of macro 'GetI64'
   63 |     GetI64(m);GetI64(a);GetI64(c);GetI64(x0);GetI64(n);GetI64(g);
      |                         ^~~~~~
foo.cc:4:24: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
    4 | #define GetI64(x) scanf("%I64d",&x)
      |                   ~~~~~^~~~~~~~~~~~
foo.cc:63:35: note: in expansion of macro 'GetI64'
   63 |     GetI64(m);GetI64(a);GetI64(c);GetI64(x0);GetI64(n);GetI64(g);
      |                                   ^~~~~~
foo.cc:4:24: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
    4 | #define GetI64(x) scanf("%I64d",&x)
      |                   ~~~~~^~~~~~~~~~~~
foo.cc:63:46: note: in expansion of macro 'GetI64'
   63 |     GetI64(m);GetI64(a);GetI64(c);GetI64(x0);GetI64(n);GetI64(g);
      |                                              ^~~~~~
foo.cc:4:24: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
    4 | #define GetI64(x) scanf("%I64d",&x)
      |                   ~~~~~^~~~~~~~~~~~
foo.cc:63:56: note: in expansion of macro 'GetI64'
   63 |     GetI64(m);GetI64(a);GetI64(c);GetI64(x0);GetI64(n);GetI64(g);
      |                                                        ^~~~~~
正在同步测试数据,请稍后
[Hydro](https://hydro.ac)提供评测服务
# 状态 耗时 内存占用
#1 Wrong Answer Read 0, expect 0. 1ms 256.0 KiB
#2 Wrong Answer Read 1, expect 1. 1ms 256.0 KiB
#3 Wrong Answer Read 46, expect 81. 1ms 256.0 KiB
#4 Wrong Answer Read 353, expect 261. 1ms 256.0 KiB
#5 Wrong Answer Read 2101, expect 2101. 2ms 256.0 KiB
#6 Wrong Answer Read 7263, expect 6631. 1ms 256.0 KiB
#7 Wrong Answer Read 83, expect 201. 2ms 256.0 KiB
#8 Wrong Answer Read 64, expect 255. 2ms 256.0 KiB
#9 Wrong Answer Read 36007370, expect 72708993. 3ms 256.0 KiB
#10 Wrong Answer Read 16549645, expect 9662152. 2ms 256.0 KiB
#11 Wrong Answer Read 4443725, expect 1825155. 1ms 256.0 KiB
#12 Wrong Answer Read 148429, expect 316481. 2ms 256.0 KiB
#13 Wrong Answer Read 1796277, expect 1118145. 1ms 256.0 KiB
#14 Wrong Answer Read 809061, expect 809061. 2ms 256.0 KiB
#15 Wrong Answer Read 13343573, expect 10845881. 1ms 256.0 KiB
#16 Wrong Answer Read 682569, expect 947514. 1ms 256.0 KiB
#17 Wrong Answer Read 8265987, expect 6555659. 2ms 256.0 KiB
#18 Wrong Answer Read 35041237, expect 53255140. 2ms 256.0 KiB
#19 Wrong Answer Read 85696908, expect 54405008. 2ms 256.0 KiB
#20 Wrong Answer Read 17917245, expect 85185812. 2ms 256.0 KiB

信息

递交者
类型
递交
题目
P1725 随机数生成器
语言
C++
递交时间
2022-04-10 21:43:51
评测时间
2022-04-10 21:43:51
评测机
分数
0
总耗时
40ms
峰值内存
256.0 KiB