For this Question: Given N integers, your task is to add these elements to the PriorityQueue. Also, given M integers, the task is to check if element is present in PriorityQueue. If present, print 1 and return the max element of priority queue, and then delete the max element. If not present, print -1.First line contains N, number of elements to be inserted into the Priority Queue. Second line contains N positive integers separated by space. Third line contains M, fourth line contains M positive integers.

Constraints:

1 <= M <= N <= 10^3
1 <= Arr[i] <= 10^3For each query, print "1" and max element in newlines if element to be found is present in the PriorityQueue, else print "-1". (use new line for each output, as shown in example)Sample Input:
1
8
1 2 3 4 5 2 3 1
5
1 3 2 9 10

Sample Output:
1
5
1
4
1
3
-1
-1, I have written this Solution Code: #include <bits/stdc++.h>
#define int long long int
#define max1 1000000007
using namespace std;
signed main(){

    int n;
    cin>>n;
    int a[n];
    priority_queue<int> q;
    for(int i=0;i<n;i++){
        cin>>a[i];
        q.push(a[i]);
    }
    int m;
    cin>>m;
    while(m--){
        cin>>a[0];
        bool win=false;
        vector<int> v;
        while(q.empty()==false){
            if(a[0]==q.top()){cout<<1<<endl;win=true;break;}
       v.emplace_back(q.top());
       q.pop();
        }
        if(q.empty()){
            cout<<-1<<endl;
        }

        for(int i=0;i<v.size();i++){
            q.push(v[i]);
        }
        if(win){
            cout<<q.top()<<endl;
            q.pop();
        }

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