Submission #954759

#TimeUsernameProblemLanguageResultExecution timeMemory
954759DragosC1Kangaroo (CEOI16_kangaroo)C++17
0 / 100
1 ms348 KiB
#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;
    n -= 2;
    for (int i = 1; i <= n; i++)
        for (int j = 1; j <= n; j++) {
            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] + dp[n][2] << '\n';
    g.close();
    return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...