Created
September 27, 2015 17:12
-
-
Save Baekjoon/69a74b9d3fe008b7ce6c to your computer and use it in GitHub Desktop.
1328
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
long long d[101][101][101]; | |
long long mod = 1000000007LL; | |
int main() { | |
int n, l, r; | |
cin >> n >> l >> r; | |
d[1][1][1] = 1LL; | |
for (int i=2; i<=n; i++) { | |
for (int j=1; j<=l; j++) { | |
for (int k=1; k<=r; k++) { | |
d[i][j][k] = d[i-1][j-1][k] + d[i-1][j][k-1] + d[i-1][j][k] * (i-2); | |
d[i][j][k] %= mod; | |
} | |
} | |
} | |
cout << d[n][l][r] << '\n'; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment