/ Vijos /

记录详情

Wrong Answer

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

信息

递交者
类型
递交
题目
P1725 随机数生成器
语言
C++
递交时间
2021-12-29 19:04:50
评测时间
2021-12-29 20:00:57
评测机
分数
0
总耗时
37ms
峰值内存
384.0 KiB