Vacation problem

Why cant we do it with a 1D array

int vacation_BU(int a[],int b[], int c[],int n){

int dp[10000];
dp[0] = max(a[0],max(b[0],c[0]));
char activity = a[0]>b[0] ? (a[0]>c[0] ? 'a' : 'c') : (b[0]>c[0] ? 'b' : 'c');
cout<<activity<<" ";
for(int i=1;i<n;i++){
    if(activity=='a'){
        dp[i] = dp[i-1] + max(b[i],c[i]);
        activity = b[i] > c[i] ? 'b' : 'c';
    }else if(activity == 'b'){
        dp[i] = dp[i-1] + max(a[i],c[i]);
        activity = a[i] > c[i] ? 'a' : 'c';
    }else{
        dp[i] = dp[i-1] + max(a[i],b[i]);
        activity = a[i] > b[i] ? 'a' : 'b';
    }

    cout<<activity<<" ";

}
return dp[n-1];

}

@duttrohan0302,
You can dry run your code on sample test cases. You will see, the subproblems don’t contain the right answer, because you are greedily choosing the largest activity, but answer can be optimum by taking not a current maximum sometimes as well.