hiho week 43 register

Ended

Participants:830

Verdict:Accepted
Score:100 / 100
Submitted:2015-05-02 01:17:57

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <cstdio>
#include <cstring>
const int MOD = 12357;
const int  M = 1<<7;
int a[M][M],b[M][M],c[M][M];
int k,n,m;
void dfs(int l,int c,int p){
    if(l>k)return;
    if(l==k){
        a[p][c]++;
        return ;
    }
    dfs(l+2,c<<2|3,p<<2|3);
    dfs(l+1,c<<1|1,p<<1);
    dfs(l+1,c<<1,p<<1|1);
}
void mul(int x[M][M],int y[M][M]){
    memset(c,0,sizeof(c));
    for(int i=0;i<m;i++)
        for(int j=0;j<m;j++)
            for(int t=0;t<m;t++){
               c[i][j]+=x[i][t]*y[t][j];
               if(c[i][j]>=MOD) c[i][j]%=MOD;
            }
    memcpy(x,c,sizeof(c));
}
int main(){
    scanf("%d%d",&k,&n);
    m=1<<k;
    if((n*k)%2==1) puts("0");   
    else{
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX