For this Question: You are given an integer array A of size N and an integer Q denoting the number of queries. Your task is to print the resultant array after applying the all queries. 
The queries can be of one of the four types.
"1" Remove the first element 
"2" Remove the second element 
"3" Remove the last element 
"4" Remove the second last element 
You can be sure that the queries are always possible.First line contains an integer N - the size of array
Next line contains N space separated integers
Next line contains an integer q - the number of queries
Next line contains Q space separated integers - denoting the type of the query. These integers are in the range of 1 to 4

Constraints
1 <= N <= 100000
1 <= Ai <= 100000
1 <= Q <= 100000Print a line containing a single integer m denoting the size of array after applying all queries.
Next line should contain m space separated integers denoting the array after applying all queries.Sample Input 1:
5
1 2 3 4 5
3 
1 4 2

Output:
2
2 5

Explanation:
Initial array = { 1, 2, 3, 4, 5 }
Remove the first element = { 2, 3, 4, 5 }
Remove the second last element = { 2, 3, 5 }
Remove the second element = { 2, 5 }

Sample Input 2:
3
1 2 3
1 
1 

Output:
2
2 3

Explanation:
Initial array = { 1, 2, 3 }
Remove the first element = { 2, 3 }, I have written this Solution Code: #include<bits/stdc++.h>
using namespace std;
#define endl            "\n"
#define ll				long long int
#define f(n) 			for(int i=0;i<n;i++)
#define fo(n)			for(int j=0;j<n;j++)
#define foo(n)			for(int i=1;i<=n;i++)
#define ff 				first
#define ss 				second
#define pb 				push_back
#define pii 			pair<int,int>
#define vi 				vector<int>
#define vp 				vector<pii>
#define test            int tt; cin>>tt; while(tt--)
#define mod 			1000000007
void fastio()
{
	ios_base::sync_with_stdio(0); cin.tie(0);
#ifndef ONLINE_JUDGE
	freopen("Input 4.txt", "r", stdin);
	freopen("Output 4.txt", "w", stdout);
#endif
}

int main() {
	fastio();
	int n;
	cin >> n;
	deque<int>a;
	int x;
	f(n) {
		cin >> x;
		a.push_back(x);
	}
	int q;
	cin >> q;
	int t;
	while (q--) {
		cin >> t;
		if (t == 1) {
			a.pop_front();
		}
		else if (t == 2) {
			int y = a.front();
			a.pop_front();
			a.pop_front();
			a.push_front(y);
		}
		else if (t == 3) {
			a.pop_back();
		}
		else {
			int y = a.back();
			a.pop_back();
			a.pop_back();
			a.push_back(y);
		}
	}
	cout << a.size() << endl;
	f(a.size()) {
		cout << a[i] << " ";
	}

}


, In this Programming Language: C++, Now tell me if this Code is compilable or not?