For this Question: An interviewer is asking you questions in form of queries. For your assistance, he has provided you with an empty array. Queries are of 4 types:-

(1 X) Add given element X to end of the array
(2 X) Delete the first instance of given element X from the array(if element is not present print -1)
(3)     Return maximum element of the array.
(4)     Return minimum element of the array.

See example for more clarificationThe first line contains an integer Q.
The next Q lines will each contain a query as mentioned above:- 

Constraints:
1 <= Q <= 100000
1 <= X <= 100000For queries 3 and 4, print the answer in a new line. If the array is empty for query 2, 3 or 4, then print "-1" without the quotes.Sample Input:-
6
1 5
1 9
1 1
3
2 1
2 1

Sample Output:-
9
-1

There are 5 queries.
Query 1 -> 5 is added to the array.
Query 2 -> 9 is added to the array.
Query 3 -> 1 is added to the array.
Query 4 -> The maximum element in the array is 9.
Query 5 -> The element 1 is deleted from the array.
Query 6 -> Since there is no element in the array with value 1, so the output is -1., I have written this Solution Code: #include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define ll long long int
#define pb push_back
#define mk make_pair
ll power(ll a, ll b) {
ll x = 1, y = a;
    while(b > 0) {
        if(b%2 == 1) {
            x=(x*y);
            if(x>mod) x%=mod;
        }
        y = (y*y);
        if(y>mod) y%=mod;
        b /= 2;
    }
    return x;
}
int a[100002];
int main()
{
	//freopen("SampleInput.in", "r", stdin);
	//freopen("SampleOutput.out", "w", stdout);
	int qu,op,x;
	memset(a,0,sizeof(a));
	priority_queue<int>q;
	priority_queue<int,vector<int>,greater<int> >q1;
	scanf("%d",&qu);
	while(qu--) {
		scanf("%d",&op);
		if(op == 1) {
			scanf("%d",&x);
			a[x]++;
			q.push(x);
			q1.push(x);
		}
		else if(op == 2) {
			scanf("%d",&x);
			if(a[x]) {
				a[x]--;
			}
			else {
				printf("-1\n");
			}
		}
		else if(op == 3) {
			while(q.size() && a[q.top()] == 0) {
				q.pop();
			}
			if(q.size()) {
				printf("%d\n",q.top());
			}
			else {
				printf("-1\n");
			}
		}
		else {
			while(q1.size() && a[q1.top()] == 0) {
				q1.pop();
			}
			if(q1.size()) {
				printf("%d\n",q1.top());
			}
			else {
				printf("-1\n");
			}
		}
	}
	return 0;
}, In this Programming Language: C++, Now tell me if this Code is compilable or not?