제출 #1118020

#제출 시각아이디문제언어결과실행 시간메모리
1118020vjudge1캥거루 (CEOI16_kangaroo)C++17
0 / 100
1 ms336 KiB
//Desinged by AzeTurk810 Open source
#include <bits/stdc++.h>
using namespace std;

# define ull unsigned long long
# define hurryup ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
# define endl '\n'
# define pb push_back
# define INF 1e10
# define vbol vector<bool>
# define vint vector<int>
# define ll long long
# define mod 1000000007

const int up = 202;

int dp[2][up][up][up];
int main()
{
    int n,cs,cf;
    cin>>n>>cs>>cf;
    
    dp[0][2][1][2] = 1;
    dp[1][2][2][1] = 1;
    for(int i=3;i<=n;i++)
    {
    	for(int l = 1;l<=n;l++)
    	{
    		for(int j =1;j<=n;j++)
    		{
    			if(l == j)continue;
    			for(int k=l;k<i;k++)
    			{
    				dp[0][i][l][j] += dp[1][i - 1][k][j - (j >= k?1:0)];
    				dp[0][i][l][j]%=mod;
    			}
    			for(int k=1;k<l;k++)
    			{
    				dp[1][i][l][j] += dp[0][i -1][k][ j - (j>= k?1:0)];
    				dp[1][i][l][j] %= mod;
    			}
    		}
    	}
    }
    cout << (dp[0][n][cs][cf] + dp[1][n][cs][cf]) % mod <<endl;
}

#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...