func_code_string: #include <bits/stdc++.h>   using namespace std;   int n;   int A[3005][5], dp[3005][3];   int solve(int x, bool a) {     int &r = dp[x][a];     if (r != -1) return r;     if (x == n) {       if (a == 0) {         return r = A[x][1];       } else {         return r = A[x][2];       }     }     if (a == 0) {       return r = max(solve(x + 1, 0) + A[x][2], solve(x + 1, 1) + A[x][1]);     } else {       return r = max(solve(x + 1, 1) + A[x][2], solve(x + 1, 0) + A[x][3]);     }   }   int main() {     scanf( %d , &n);     for (int i = 1; i <= 3; i++)       for (int j = 1; j <= n; j++) {         scanf( %d , A[j] + i);       }     memset(dp, -1, sizeof dp);     cout << solve(1, 0) << endl;     return 0;   }   