hihoCoder Challenge 13 register

Ended

Participants:447

Verdict:Accepted
Submitted:2015-07-26 20:36:27

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>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<string>
using namespace std;
typedef long long LL;
#define MAXN 105
#define MOD 1000000007
int n,m,_,i,j,a,b,dp[MAXN][MAXN],vis[MAXN][MAXN];
int dfs(int y,int x)
{
    //if(x == 0 || y == 0)return 1;
    if(dp[y][x])return dp[y][x];
    int curx = 0,cury = 0;
    if(x + b > m || x + b < 1)
    {
        curx = !vis[y][x];
        vis[y][x] = true;
    }
    else curx = dfs(y,x + b);
    if(y + a > n || y + a < 1)
    {
        cury = !vis[y][x];
        vis[y][x] = true;
    }
    else cury = dfs(y + a,x);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX