hiho Week 9 register

Ended

Participants:362

Verdict:Accepted
Score:100 / 100
Submitted:2014-09-02 10:28:36

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 <iostream>
#include <cstring>
using namespace std;
long long sum[2][1<<6];//
const int dvi=1000000007;
void dfs(int col,int next,int prev,int t,int w)//DP
{
    if(col==w){
        sum[t%2][next]+=sum[(t+1)%2][prev];
        sum[t%2][next]%=dvi;
        return;
    }else{
        if(col+1<=w){
            dfs(col+1,(next<<1)|1,prev<<1,t,w);//
            dfs(col+1,next<<1,(prev<<1)|1,t,w);//
        }
        if(col+2<=w){
            dfs(col+2,(next<<2)|3,(prev<<2)|3,t,w);//
        }
    }
}
int main()
{
    int h,w;
    cin>>h>>w;
    if((h*w)%2){
        cout<<0<<endl;
    }else{
        if(h<w){
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX