| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 311309 | jainbot27 | 캥거루 (CEOI16_kangaroo) | C++17 | 39 ms | 31616 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "iostream"
using namespace std;
const int64_t MOD = 1e9 + 7;
int64_t dp[2001][2001];
int main(){
int n, a, b;
cin >> n >> a >> b;
dp[0][0] = 1;
for(int i = 1; i <= n; i++)
for(int j = 1; j <= n; j++){
if(i == a || i == b)
dp[i][j] = (dp[i-1][j] + dp[i-1][j-1]) % MOD;
else
dp[i][j] = (dp[i-1][j+1] * j + dp[i-1][j-1] * (j - (i > a) - (i > b))) % MOD;
}
cout << dp[n][1];
}| # | 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... | ||||
