Submission #954787

# Submission time Handle Problem Language Result Execution time Memory
954787 2024-03-28T14:29:53 Z DragosC1 Kangaroo (CEOI16_kangaroo) C++17
0 / 100
1 ms 344 KB
#include <bits/stdc++.h>
using namespace std;

int dp[2005][2005];

int main() {    
    ifstream f("kangaroo.in");
    int n, start, finish;
    f >> n >> start >> finish;
    f.close();
    dp[0][0] = 1;
    for (int i = 1; i <= n; i++)
        for (int j = 1; j <= n; j++) {
            if (i == start) {
                dp[i][j] += dp[i - 1][j] + dp[i - 1][j - 1];
            }
            else if (i == finish) {
                dp[i][j] += dp[i - 1][j] + dp[i - 1][j - 1];
            }
            else {
                dp[i][j] += j * dp[i - 1][j - 1];
                dp[i][j] += j * dp[i - 1][j + 1];
            }
        }
    ofstream g("kangaroo.out");
    cout << dp[n][1] << '\n';
    g.close();
    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -