제출 #1117834

#제출 시각아이디문제언어결과실행 시간메모리
1117834vjudge1캥거루 (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 + 1); 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]; }

컴파일 시 표준 에러 (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...