# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1117832 | vjudge1 | Kangaroo (CEOI16_kangaroo) | C++17 | 3 ms | 592 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
// author - alimammadzade
#include <bits/stdc++.h>
using namespace std;
signed main() {
cin.tie(nullptr)->sync_with_stdio(0);
//system("cls"), freopen("in.txt", "r", stdin);
freopen("kangaroo.in", "r", stdin);
freopen("kangaroo.out", "r", stdout);
int n, s, f;
cin >> n >> s >> f;
vector<array<int, 2>> dp(n);
dp[s] = { 1, 1 };
for (int i = 1; i <= n; i++) {
for (int j = i + 1; j <= n; j++) dp[i][0] += dp[j][1];
for (int j = 1; j < i; j++) dp[i][1] += dp[j][0];
}
cout << dp[f][0] + dp[f][1];
}
Compilation message (stderr)
# | 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... |