# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
465451 | fuad27 | Kangaroo (CEOI16_kangaroo) | C++17 | 31 ms | 31908 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define mod 1000000007
#define MAXN 2010
#define int long long
void solve() {
ll n, s , e;
cin >> n >> s >> e;
ll dp[n+10][n+10] = {0};
dp[1][1] = 1;
for(int i = 2;i<=n;i++) {
for(int j = 1;j<=i;j++) {
if(i == s or i == e) {
dp[i][j] = (dp[i-1][j-1]+dp[i-1][j])%mod;
}
else {
dp[i][j] = (dp[i-1][j+1]*j%mod + dp[i-1][j-1] * (j - (s<i) - (e<i))%mod)%mod;
}
}
}
cout<<dp[n][1]<<endl;
}
int32_t main () {/*
#ifndef ONLINE_JUDGE
freopen("stdin", "r", stdin);
freopen("stdout", "w", stdout);
freopen("stderr", "w", stderr);
#endif*/
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |