Submission #1117832

#TimeUsernameProblemLanguageResultExecution timeMemory
1117832vjudge1Kangaroo (CEOI16_kangaroo)C++17
0 / 100
3 ms592 KiB
// 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)

kangaroo.cpp: In function 'int main()':
kangaroo.cpp:9:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
    9 |     freopen("kangaroo.in", "r", stdin);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
kangaroo.cpp:10:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   10 |     freopen("kangaroo.out", "r", stdout);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...