For this Question: You have an empty sequence A. Along with that you are given an array B of size N. You create a new integer i = 0 and perform N operations on the sequence A in the following way:
<ul>
<li>Check if i == N + 1, break. </li>
<li>Append B<sub>i</sub> to the end of A and increment i by 1. </li>
<li>Reverse the sequence A. </li>
Find the sequence A after all the operations.The first line of the input contains a single integer N.
The second line of the input contains N space seperated integers.

Constraints:
1 <= N <= 10<sup>5</sup>
1 <= B<sub>i</sub> <= 10<sup>9</sup>Print the sequence A after all the operations.Sample Input:
4
1 2 3 4

Sample Output:
4 2 1 3, I have written this Solution Code: #include <bits/stdc++.h>
using namespace std;

int main(){
    int n;
	cin >> n;
    vector<int> A(n + 1), B(n + 1);
	for(int i = 1; i <= n; i++)
        cin >> A[i];
	int head = 1, tail = n;
	int f = 0, k = n;
	while(head <= tail){
		if(f == 0) B[head++] = A[k--];
		else B[tail--] = A[k--];
		f ^= 1;
	}
	for(int i = 1; i < n; i++)
        cout << B[i] << ' ';
	printf("%d",B[n]);
}, In this Programming Language: C++, Now tell me if this Code is compilable or not?