criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <iostream>
#include <queue>

using namespace std;

int main(){
	priority_queue<int> priorityqueue;//優先順位キュー
	char loader[8];//ローダー(char*)
	int loadnum;//ローダー(int)

	while (1){
		cin >> loader;
		if (strcmp(loader, "insert") == 0){
			cin >> loadnum;
			priorityqueue.push(loadnum);
		}
		if (strcmp(loader, "extract") == 0){
			cout << priorityqueue.top() << endl;
			priorityqueue.pop();
		}
		if (strcmp(loader, "end") == 0){
			break;
		}
	}

}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:21: error: 'strcmp' was not declared in this scope
   13 |                 if (strcmp(loader, "insert") == 0){
      |                     ^~~~~~
a.cc:3:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <queue>
  +++ |+#include <cstring>
    3 | 
a.cc:17:21: error: 'strcmp' was not declared in this scope
   17 |                 if (strcmp(loader, "extract") == 0){
      |                     ^~~~~~
a.cc:17:21: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:21:21: error: 'strcmp' was not declared in this scope
   21 |                 if (strcmp(loader, "end") == 0){
      |                     ^~~~~~
a.cc:21:21: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include <iostream>
#include <cstdlib>
#include <queue>

using namespace std;

int main(){
	priority_queue<int> priorityqueue;//優先順位キュー
	char loader[8];//ローダー(char*)
	int loadnum;//ローダー(int)

	while (1){
		cin >> loader;
		if (strcmp(loader, "insert") == 0){
			cin >> loadnum;
			priorityqueue.push(loadnum);
		}
		if (strcmp(loader, "extract") == 0){
			cout << priorityqueue.top() << endl;
			priorityqueue.pop();
		}
		if (strcmp(loader, "end") == 0){
			break;
		}
	}

}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:21: error: 'strcmp' was not declared in this scope
   14 |                 if (strcmp(loader, "insert") == 0){
      |                     ^~~~~~
a.cc:4:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <queue>
  +++ |+#include <cstring>
    4 | 
a.cc:18:21: error: 'strcmp' was not declared in this scope
   18 |                 if (strcmp(loader, "extract") == 0){
      |                     ^~~~~~
a.cc:18:21: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:22:21: error: 'strcmp' was not declared in this scope
   22 |                 if (strcmp(loader, "end") == 0){
      |                     ^~~~~~
a.cc:22:21: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
#define MAX 2000000
#difine INFTY(1<<30)

int n,A[MAX+1];

void maximumHeap(int i){
int l,r,largest;
l=2*i;
r=2*i+1;

if(l<=n && A[l]>A[i]){
largest=l;
}
else{
largest=i;
}
if(r<=n && A[r]>A[largest]){
largest=l;
}

if(largest != i){
swap(A[i],A[largest]);
maximumHeap(largest);
}
}

int extract(){
int maxv;

if(n<1)return -INFTY;
maxv=A[1];
A[1]=A[n--];
maximumHeap(1);
return maxv;
}

void Key(int i,int key){
if(key<A[i])return;
A[i]=key;
while(i>1 && A[i/2]<A[i]){
swap(A[i],A[i/2]);
i=i/2;
}
}

void insert(int key){
n++;
A[n]=-INFTY;
Key(n,key);
}

int main(void){
int key;
char com[10];

while(1){
scanf("%s",com);
if(com[0] == 'e' && com[1] == 'n')break;
if(com[0] == 'i'){
scanf("%d",&key);
insert(key);
}
else{
printf("%d\n",extract());
}
}

return 0;
}

Compiler output:
a.cc:6:2: error: invalid preprocessing directive #difine; did you mean #define?
    6 | #difine INFTY(1<<30)
      |  ^~~~~~
      |  define
a.cc: In function 'int extract()':
a.cc:34:16: error: 'INFTY' was not declared in this scope
   34 | if(n<1)return -INFTY;
      |                ^~~~~
a.cc: In function 'void insert(int)':
a.cc:52:7: error: 'INFTY' was not declared in this scope
   52 | A[n]=-INFTY;
      |       ^~~~~
Language: C++

#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
#define MAX 2000000
#define INFTY(1<<30)

int n,A[MAX+1];

void maximumHeap(int i){
int l,r,largest;
l=2*i;
r=2*i+1;

if(l<=n && A[l]>A[i]){
largest=l;
}
else{
largest=i;
}
if(r<=n && A[r]>A[largest]){
largest=l;
}

if(largest != i){
swap(A[i],A[largest]);
maximumHeap(largest);
}
}

int extract(){
int maxv;

if(n<1)return -INFTY;
maxv=A[1];
A[1]=A[n--];
maximumHeap(1);
return maxv;
}

void Key(int i,int key){
if(key<A[i])return;
A[i]=key;
while(i>1 && A[i/2]<A[i]){
swap(A[i],A[i/2]);
i=i/2;
}
}

void insert(int key){
n++;
A[n]=-INFTY;
Key(n,key);
}

int main(void){
int key;
char com[10];

while(1){
scanf("%s",com);
if(com[0] == 'e' && com[1] == 'n')break;
if(com[0] == 'i'){
scanf("%d",&key);
insert(key);
}
else{
printf("%d\n",extract());
}
}

return 0;
}

Compiler output:
a.cc:6:15: error: expected parameter name, found "1"
    6 | #define INFTY(1<<30)
      |               ^
a.cc: In function 'int extract()':
a.cc:34:16: error: 'INFTY' was not declared in this scope
   34 | if(n<1)return -INFTY;
      |                ^~~~~
a.cc: In function 'void insert(int)':
a.cc:52:7: error: 'INFTY' was not declared in this scope
   52 | A[n]=-INFTY;
      |       ^~~~~
Language: C++


#include <iostream>
#include <algorithm>
#include <vector>
#include <math.h>
#include <cmath>
#include <utility>
#include <queue>
#include <stdio.h>
#include <string>
#include <map>
#include <stack>
#include <complex>
#define REP(i,n) for(int i=0;i<n;i++)
#define INF 1000000000007
#define ESP 1e-11
using namespace std;
typedef long long int ll;

class HeapSort{
private:
    vector<int> heapify(vector<int> a, int i){
        if (i>=a.size()/2) return a;
        int l = 0, r = 0,large = a[i], flag = -1;
        if(2*i+1 < a.size()) l = a[2*i+1];
        if(2*(i+1) < a.size()) r = a[2*(i+1)];
        if(large < l){
            a[i] = l;
            a[2*i+1] = large;
            large = l;
            flag = 2*i+1;
        }
        if(large < r){
            a[i] = r;
            a[2*(i+1)] = large;
            large = r;
            flag = 2*(i+1);
        }
        return heapify(a, flag);
    };
    
    vector<int> heap_max(vector<int> a, int size){
        for (int i = size/2-1; i>=0; i--) {
            a = heapify(a, i);
        }
        return a;
    };
public:
    vector<int> heapsort(vector<int> a){
        vector<int> res;
        int length = static_cast<int>(a.size());
        a = heap_max(a, length);
        for (int i = length-1; i>1; i--) {
            res.push_back(a[0]);
            a[0] = a[i];
            a[i] = -1*INT_MAX;
            a = heap_max(a, i);
        }
        res.push_back(a[0]);
        res.push_back(a[1]);
        return res;
    };
};

int main(){
    vector<int> he(0,0);
    HeapSort h;
    while (1) {
        string s;
        cin >> s;
        if(s == "end")break;
        if (s == "extract") {
            he = h.heapsort(he);
            cout << he[0] << endl;;
            he[0] = 0;
            continue;
        }
        if(s == "insert"){
            int n;
            cin >> n;
            he.push_back(n);
        }
    }
}

Compiler output:
a.cc: In member function 'std::vector<int> HeapSort::heapsort(std::vector<int>)':
a.cc:56:23: error: 'INT_MAX' was not declared in this scope
   56 |             a[i] = -1*INT_MAX;
      |                       ^~~~~~~
a.cc:14:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   13 | #include <complex>
  +++ |+#include <climits>
   14 | #define REP(i,n) for(int i=0;i<n;i++)
Language: C++


#include <iostream>
#include <algorithm>
#include <vector>
#include <math.h>
#include <cmath>
#include <utility>
#include <queue>
#include <stdio.h>
#include <string>
#include <map>
#include <stack>
#include <complex>
#define REP(i,n) for(int i=0;i<n;i++)
#define INF 1000000000007
#define ESP 1e-11
using namespace std;
typedef long long int ll;


vector<int> heapify(vector<int> a, int i){
    if (i>=a.size()/2) return a;
    int l = 0, r = 0,large = a[i], flag = -1;
    if(2*i+1 < a.size()) l = a[2*i+1];
    if(2*(i+1) < a.size()) r = a[2*(i+1)];
    if(large < l){
        a[i] = l;
        a[2*i+1] = large;
        large = l;
        flag = 2*i+1;
    }
    if(large < r){
        a[i] = r;
        a[2*(i+1)] = large;
        large = r;
        flag = 2*(i+1);
    }
    return heapify(a, flag);
}

vector<int> heap_max(vector<int> a, int size){
    for (int i = size/2-1; i>=0; i--) {
        a = heapify(a, i);
    }
    return a;
}

vector<int> heapsort(vector<int> a){
    vector<int> res;
    int length = static_cast<int>(a.size());
    a = heap_max(a, length);
    for (int i = length-1; i>1; i--) {
        res.push_back(a[0]);
        a[0] = a[i];
        a[i] = -1*INT_MAX;
        a = heap_max(a, i);
    }
    res.push_back(a[0]);
    res.push_back(a[1]);
    return res;
}

int main(){
    vector<int> he(0,0);
    while (1) {
        string s;
        cin >> s;
        if(s == "end")break;
        if (s == "extract") {
            he = heapsort(he);
            cout << he[0] << endl;;
            he[0] = 0;
            continue;
        }
        if(s == "insert"){
            int n;
            cin >> n;
            he.push_back(n);
        }
    }
}

Compiler output:
a.cc: In function 'std::vector<int> heapsort(std::vector<int>)':
a.cc:55:19: error: 'INT_MAX' was not declared in this scope
   55 |         a[i] = -1*INT_MAX;
      |                   ^~~~~~~
a.cc:14:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   13 | #include <complex>
  +++ |+#include <climits>
   14 | #define REP(i,n) for(int i=0;i<n;i++)
Language: C++

import java.io.*;
import java.util.PriorityQueue;
import java.util.StringTokenizer;

class Main{

static final PrintWriter out=new PrintWriter(System.out);

public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
PriorityQueue<Integer> pque=new PriorityQueue<Integer>(10,new Comparator<Integer>(){
public int compare(Integer a,Integer b){
return (a>b)?-1:(a<b)?1:0;
}
});

int num=Integer.parseInt(br.readLine());
while(num-->0){
StringTokenizer st=new StringTokenizer(br.readLine());
String command=st.nextToken();
if("insert".equals(command)){
int n=Integer.parseInt(st.nextToken());
pque.offer(n);
}
else out.println(pque.poll);
}
out.flush();
}
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.io.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.util.PriorityQueue;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import java.util.StringTokenizer;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:7:8: error: 'final' does not name a type
    7 | static final PrintWriter out=new PrintWriter(System.out);
      |        ^~~~~
a.cc:9:7: error: expected ':' before 'static'
    9 | public static void main(String[] args) throws IOException{
      |       ^~~~~~~
      |       :
a.cc:9:25: error: 'String' has not been declared
    9 | public static void main(String[] args) throws IOException{
      |                         ^~~~~~
a.cc:9:34: error: expected ',' or '...' before 'args'
    9 | public static void main(String[] args) throws IOException{
      |                                  ^~~~
a.cc:9:38: error: expected ';' at end of member declaration
    9 | public static void main(String[] args) throws IOException{
      |                                      ^
      |                                       ;
a.cc:9:40: error: 'throws' does not name a type
    9 | public static void main(String[] args) throws IOException{
      |                                        ^~~~~~
a.cc:29:2: error: expected ';' after class definition
   29 | }
      |  ^
      |  ;
Language: C++

import java.io.*;
import java.util.Comparator;
import java.util.PriorityQueue;
import java.util.StringTokenizer;
 
class Main{
 
static final PrintWriter out=new PrintWriter(System.out);
 
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
PriorityQueue pque=new PriorityQueue(10,new Comparator(){
public int compare(Object o1,Object o2){
int n1=(int)o1;
int n2=(int)o2;
return (n1>n2)?1:(n1<n2)?-1:0;
}
});
int num=Integer.parseInt(br.readLine());
int n;
while(num-->0){
StringTokenizer st=new StringTokenizer(br.readLine());
String command=st.nextToken();
if("insert".equals(command)){
n=Integer.parseInt(st.nextToken());
pque.offer(n);
}
else out.println(pque.poll());
}
out.flush();
}
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.io.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.util.Comparator;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import java.util.PriorityQueue;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: 'import' does not name a type
    4 | import java.util.StringTokenizer;
      | ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:8:8: error: 'final' does not name a type
    8 | static final PrintWriter out=new PrintWriter(System.out);
      |        ^~~~~
a.cc:10:7: error: expected ':' before 'static'
   10 | public static void main(String[] args) throws IOException{
      |       ^~~~~~~
      |       :
a.cc:10:25: error: 'String' has not been declared
   10 | public static void main(String[] args) throws IOException{
      |                         ^~~~~~
a.cc:10:34: error: expected ',' or '...' before 'args'
   10 | public static void main(String[] args) throws IOException{
      |                                  ^~~~
a.cc:10:38: error: expected ';' at end of member declaration
   10 | public static void main(String[] args) throws IOException{
      |                                      ^
      |                                       ;
a.cc:10:40: error: 'throws' does not name a type
   10 | public static void main(String[] args) throws IOException{
      |                                        ^~~~~~
a.cc:32:2: error: expected ';' after class definition
   32 | }
      |  ^
      |  ;
Language: C++

#include <set>
#include <string>
#include <iostream>
using namespace std;

int main() {
  int n; // number of lines for input
  unordered_set <string> A;
  string command; // either insert or find
  string word; // string to insert
  cin >> n;
  for (int i=0; i<n; ++i) {
    cin >> command;
    if (command == "insert") {
      cin >> word;
      if (word.size() > 12) break;
      A.insert(word);
    }
    else if (command == "find") {
      cin >> word;
      if (A.count(word) == 1) cout << "yes" << endl;
      else cout << "no" << endl;
    }
    else break;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'unordered_set' was not declared in this scope
    8 |   unordered_set <string> A;
      |   ^~~~~~~~~~~~~
a.cc:4:1: note: 'std::unordered_set' is defined in header '<unordered_set>'; this is probably fixable by adding '#include <unordered_set>'
    3 | #include <iostream>
  +++ |+#include <unordered_set>
    4 | using namespace std;
a.cc:8:24: error: expected primary-expression before '>' token
    8 |   unordered_set <string> A;
      |                        ^
a.cc:8:26: error: 'A' was not declared in this scope
    8 |   unordered_set <string> A;
      |                          ^
Language: C++

#include <iostream>
#include <cstdio>
#include <queue>
#include <vector>

using namespace std;

void solve()
{
	priority_queue<int> pque;
	char order[10] = "";
	while (true)
	{
		cin >> order;
		//scanf_s(" %s", order);
		if (order[2] == 'd')
		{
			break;
		}
		else if (order[0] == 'i')
		{
			int num;
			scanf_s("%d", &num);
			pque.push(num);
		}
		else
		{
			printf("%d\n", pque.top());
			pque.pop();
		}
	}
}

int main()
{
	solve();
	return(0);
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:23:25: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   23 |                         scanf_s("%d", &num);
      |                         ^~~~~~~
      |                         scanf
Language: C++

#include <iostream>
#include <algorithm>
#include <stack>
#include <string>
#include <queue>
#include <cstdlib>
#include <cstdio>
#include <vector>
#include <list>
#include <string.h>
#define _USE_MATH_DEFINES
#include <math.h>
#include <map>
#define INFTY (1<<30)

using namespace std;

int h = 0, a[2000000+1];

void maxHeapify( int i) {
	int l = 2*i, r = 2*i+1;
	int largest;
	if( l <= h && a[l] > a[i]) largest = l;
	else largest = i;
	if( r <= h && a[r] > a[largest]) largest = r;
	
	if( largest != i) {
		swap(a[i], a[largest]);
		maxHeapify(largest);
	}
	return;
}

void increaseKey(int i, int k) {
	if( k < a[i]) return;
	a[i] = k;
	while( i > 1 && a[i/2] < a[i]) {
		swap(a[i], a[i/2]);
		i = i/2;
	}
}

int extract() {
	if(h < 1) return -INFTY;
	int max = a[1];
	a[1] = a[h--];
	maxHeapify(1);
	return max;
}

int main(){
	while(1) {
		string str;
		int k;
		cin >> str;
		if(str[0] == 'e' && str[1] == 'n') break;
		else if(str[0] == 'i') {
			cin >> k;
			h++;
			a[h] = -INFTY;
			increaseKey(h, k);
		} else {
			cout << extract() <<endl;
		}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:66:2: error: expected '}' at end of input
   66 | }
      |  ^
a.cc:51:11: note: to match this '{'
   51 | int main(){
      |           ^
Language: C++

#include <iostream>
#include <algorithm>
#include <string>
using namespace std;

const long MAX = 2000000;
const long INFTY (1<<30);

long H, A[MAX + 1];

void maxHeapify(long i){
	long l = 2 * i;
	long r = 2 * i + 1;

	long largest;
	if (l <= H && A[l] > A[i]){
		largest = l;
	}
	else {
		largest = i;
	}
	if (r <= H && A[r] > A[largest]){
		largest = r;
	}

	if (largest != i){
		swap(A[i], A[largest]);
		maxHeapify(A, largest);
	}
}

long extract(){
	long maxv;
	if (H < 1) return -INFTY;
	maxv = A[1];
	A[1] = A[H--];
	maxHeapify(1);
	return maxv;
}

void increaseKey(long i, long key){
	if (key < A[i]) return;
	A[i] = key;
	while (i > 1 && A[i / 2] < A[i]){
		swap(A[i], A[i / 2]);
		i /= 2;
	}
}

void insert(long key){
	H++;
	A[H] = -INFTY;
	increaseKey(H, key);
}

int main(){
	long key;
	string com;

	while (1){
		cin >> com;
		if (com[0] == 'e' && com[1] == 'n') break;
		if (com[0] == 'i'){
			cin >> key;
			insert(key);
		}
		else {
			cout << extract() << endl;
		}
	}

	return 0;
}

Compiler output:
a.cc: In function 'void maxHeapify(long int)':
a.cc:28:28: error: invalid conversion from 'long int*' to 'long int' [-fpermissive]
   28 |                 maxHeapify(A, largest);
      |                            ^
      |                            |
      |                            long int*
a.cc:28:27: error: too many arguments to function 'void maxHeapify(long int)'
   28 |                 maxHeapify(A, largest);
      |                 ~~~~~~~~~~^~~~~~~~~~~~
a.cc:11:6: note: declared here
   11 | void maxHeapify(long i){
      |      ^~~~~~~~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <string>
using namespace std;

const long MAX 2000000;
const long INFTY (1<<30); // 2^30

long H, A[MAX + 1];

void maxHeapify(long i){
	long l = 2 * i;
	long r = 2 * i + 1;

	long largest;
	if (l <= H && A[l] > A[i]){
		largest = l;
	}
	else {
		largest = i;
	}
	if (r <= H && A[r] > A[largest]){
		largest = r;
	}

	if (largest != i){
		swap(A[i], A[largest]);
		maxHeapify(largest);
	}
}

long extract(){
	long maxv;
	if (H < 1) return -INFTY;
	maxv = A[1];
	A[1] = A[H--];
	maxHeapify(1);
	return maxv;
}

void increaseKey(long i, long key){
	if (key < A[i]) return;
	A[i] = key;
	while (i > 1 && A[i / 2] < A[i]){
		swap(A[i], A[i / 2]);
		i /= 2;
	}
}

void insert(long key){
	H++;
	A[H] = -INFTY;
	increaseKey(H, key);
}

int main(){
	long key;
	string com;

	while (1){
		cin >> com;
		if (com[0] == 'e' && com[1] == 'n') break;
		if (com[0] == 'i'){
			cin >> key;
			insert(key);
		}
		else {
			cout << extract() << endl;
		}
	}

	return 0;
}

Compiler output:
a.cc:6:16: error: expected initializer before numeric constant
    6 | const long MAX 2000000;
      |                ^~~~~~~
a.cc:9:11: error: 'MAX' was not declared in this scope
    9 | long H, A[MAX + 1];
      |           ^~~
a.cc: In function 'void maxHeapify(long int)':
a.cc:16:23: error: 'A' was not declared in this scope
   16 |         if (l <= H && A[l] > A[i]){
      |                       ^
a.cc:22:23: error: 'A' was not declared in this scope
   22 |         if (r <= H && A[r] > A[largest]){
      |                       ^
a.cc:27:22: error: 'A' was not declared in this scope
   27 |                 swap(A[i], A[largest]);
      |                      ^
a.cc: In function 'long int extract()':
a.cc:35:16: error: 'A' was not declared in this scope
   35 |         maxv = A[1];
      |                ^
a.cc: In function 'void increaseKey(long int, long int)':
a.cc:42:19: error: 'A' was not declared in this scope
   42 |         if (key < A[i]) return;
      |                   ^
a.cc:43:9: error: 'A' was not declared in this scope
   43 |         A[i] = key;
      |         ^
a.cc: In function 'void insert(long int)':
a.cc:52:9: error: 'A' was not declared in this scope
   52 |         A[H] = -INFTY;
      |         ^
Language: C++

#include <stdio.h>
int val, size, heap[2097168]; char c[9];
inline void swap(int &x, int &y) {
	int tmp = *x;
	*x = *y, *y = tmp;
}
inline void insert(int x) {
	int ptr = size++; heap[ptr] = x;
	while(ptr) {
		if(heap[ptr >> 1] < heap[ptr]) swap(heap[ptr], heap[ptr >> 1]);
		ptr >>= 1;
	}
}
inline int extract() {
	int ret = heap[1], ptr = 1;
	while((ptr << 1) + 1 < size) {
		ptr <<= 1;
		if(heap[ptr] > heap[ptr + 1]) swap(heap[ptr >> 1], heap[ptr]);
		else swap(heap[ptr + 1], heap[ptr >> 1]), ptr++;
	}
	heap[ptr] = heap[--size], heap[size] = 0;
	while(ptr) {
		if(heap[ptr >> 1] < heap[ptr]) swap(heap[ptr], heap[ptr >> 1]);
		ptr >>= 1;
	}
	return ret;
}
int main() {
	size = 1;
	while(scanf("%s", c), c[2] != 'd') {
		if(c[0] == 'i') scanf("%d", val), insert(val);
		else printf("%d\n", extract());
	}
}

Compiler output:
a.cc: In function 'void swap(int&, int&)':
a.cc:4:19: error: invalid type argument of unary '*' (have 'int')
    4 |         int tmp = *x;
      |                   ^~
a.cc:5:9: error: invalid type argument of unary '*' (have 'int')
    5 |         *x = *y, *y = tmp;
      |         ^~
a.cc:5:14: error: invalid type argument of unary '*' (have 'int')
    5 |         *x = *y, *y = tmp;
      |              ^~
a.cc:5:18: error: invalid type argument of unary '*' (have 'int')
    5 |         *x = *y, *y = tmp;
      |                  ^~
Language: C++

#include <vector>
#include <algorithm>
using namespace std;
template<class T> class PriorityQueue {
private:
	size_t size_; vector<T> heap;
public:
	PriorityQueue() : size_(0), heap(vector<T>(1, 0)) {};
	PriorityQueue(PriorityQueue& que) : size_(que.size()), heap(que.heap) {};
	size_t size() { return size_; }
	inline void insert(int x) {
		int ptr = size_++; heap.push_back(x);
		while (ptr > 1) {
			if (heap[ptr >> 1] < heap[ptr]) swap(heap[ptr], heap[ptr >> 1]);
			ptr >>= 1;
		}
	}
	inline int extract() {
		int ret = heap[1], ptr = 1;
		while ((ptr << 1) + 1 < size_) {
			ptr <<= 1;
			if (heap[ptr] > heap[ptr + 1]) swap(heap[ptr >> 1], heap[ptr]);
			else swap(heap[ptr + 1], heap[ptr >> 1]), ptr++;
		}
		heap[ptr] = heap[--size_]; heap.pop_back();
		while (ptr > 1) {
			if (heap[ptr >> 1] < heap[ptr]) swap(heap[ptr], heap[ptr >> 1]);
			ptr >>= 1;
		}
		return ret;
	}
};
char c[9]; int v;
int main() {
	PriorityQueue que;
	while(scanf("%s", c) != 3) {
		if(c == 'i') scanf("%d", &v), que.insert(v);
		else printf("%d\n", extract());
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:23: error: class template argument deduction failed:
   35 |         PriorityQueue que;
      |                       ^~~
a.cc:35:23: error: no matching function for call to 'PriorityQueue()'
a.cc:9:9: note: candidate: 'template<class T> PriorityQueue(PriorityQueue<T>&)-> PriorityQueue<T>'
    9 |         PriorityQueue(PriorityQueue& que) : size_(que.size()), heap(que.heap) {};
      |         ^~~~~~~~~~~~~
a.cc:9:9: note:   candidate expects 1 argument, 0 provided
a.cc:8:9: note: candidate: 'template<class T> PriorityQueue()-> PriorityQueue<T>'
    8 |         PriorityQueue() : size_(0), heap(vector<T>(1, 0)) {};
      |         ^~~~~~~~~~~~~
a.cc:8:9: note:   template argument deduction/substitution failed:
a.cc:35:23: note:   couldn't deduce template parameter 'T'
   35 |         PriorityQueue que;
      |                       ^~~
a.cc:4:25: note: candidate: 'template<class T> PriorityQueue(PriorityQueue<T>)-> PriorityQueue<T>'
    4 | template<class T> class PriorityQueue {
      |                         ^~~~~~~~~~~~~
a.cc:4:25: note:   candidate expects 1 argument, 0 provided
a.cc:36:15: error: 'scanf' was not declared in this scope
   36 |         while(scanf("%s", c) != 3) {
      |               ^~~~~
a.cc:37:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   37 |                 if(c == 'i') scanf("%d", &v), que.insert(v);
      |                    ~~^~~~~~
a.cc:38:37: error: 'extract' was not declared in this scope
   38 |                 else printf("%d\n", extract());
      |                                     ^~~~~~~
a.cc:38:22: error: 'printf' was not declared in this scope
   38 |                 else printf("%d\n", extract());
      |                      ^~~~~~
a.cc:3:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    2 | #include <algorithm>
  +++ |+#include <cstdio>
    3 | using namespace std;
Language: C++

#include <vector>
#include <algorithm>
using namespace std;
template<class T> class PriorityQueue {
private:
	size_t size_; vector<T> heap;
public:
	PriorityQueue() : size_(0), heap(vector<T>(1, 0)) {};
	PriorityQueue(PriorityQueue& que) : size_(que.size()), heap(que.heap) {};
	size_t size() { return size_; }
	inline void insert(int x) {
		int ptr = size_++; heap.push_back(x);
		while (ptr > 1) {
			if (heap[ptr >> 1] < heap[ptr]) swap(heap[ptr], heap[ptr >> 1]);
			ptr >>= 1;
		}
	}
	inline int extract() {
		int ret = heap[1], ptr = 1;
		while ((ptr << 1) + 1 < size_) {
			ptr <<= 1;
			if (heap[ptr] > heap[ptr + 1]) swap(heap[ptr >> 1], heap[ptr]);
			else swap(heap[ptr + 1], heap[ptr >> 1]), ptr++;
		}
		heap[ptr] = heap[--size_]; heap.pop_back();
		while (ptr > 1) {
			if (heap[ptr >> 1] < heap[ptr]) swap(heap[ptr], heap[ptr >> 1]);
			ptr >>= 1;
		}
		return ret;
	}
};
char c[9]; int v;
int main() {
	PriorityQueue que;
	while(scanf("%s", c) != 3) {
		if(*c == 'i') scanf("%d", &v), que.insert(v);
		else printf("%d\n", extract());
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:23: error: class template argument deduction failed:
   35 |         PriorityQueue que;
      |                       ^~~
a.cc:35:23: error: no matching function for call to 'PriorityQueue()'
a.cc:9:9: note: candidate: 'template<class T> PriorityQueue(PriorityQueue<T>&)-> PriorityQueue<T>'
    9 |         PriorityQueue(PriorityQueue& que) : size_(que.size()), heap(que.heap) {};
      |         ^~~~~~~~~~~~~
a.cc:9:9: note:   candidate expects 1 argument, 0 provided
a.cc:8:9: note: candidate: 'template<class T> PriorityQueue()-> PriorityQueue<T>'
    8 |         PriorityQueue() : size_(0), heap(vector<T>(1, 0)) {};
      |         ^~~~~~~~~~~~~
a.cc:8:9: note:   template argument deduction/substitution failed:
a.cc:35:23: note:   couldn't deduce template parameter 'T'
   35 |         PriorityQueue que;
      |                       ^~~
a.cc:4:25: note: candidate: 'template<class T> PriorityQueue(PriorityQueue<T>)-> PriorityQueue<T>'
    4 | template<class T> class PriorityQueue {
      |                         ^~~~~~~~~~~~~
a.cc:4:25: note:   candidate expects 1 argument, 0 provided
a.cc:36:15: error: 'scanf' was not declared in this scope
   36 |         while(scanf("%s", c) != 3) {
      |               ^~~~~
a.cc:38:37: error: 'extract' was not declared in this scope
   38 |                 else printf("%d\n", extract());
      |                                     ^~~~~~~
a.cc:38:22: error: 'printf' was not declared in this scope
   38 |                 else printf("%d\n", extract());
      |                      ^~~~~~
a.cc:3:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    2 | #include <algorithm>
  +++ |+#include <cstdio>
    3 | using namespace std;
Language: C++

#include <vector>
#include <algorithm>
using namespace std;
#include <vector>
#include <algorithm>
using namespace std;
template<class T> class PriorityQueue {
private:
	size_t size_; vector<T> heap;
public:
	PriorityQueue() : size_(1), heap(vector<T>(1, 0)) {};
	PriorityQueue(PriorityQueue& que) : size_(que.size_), heap(que.heap) {};
	size_t size() { return size_ - 1; }
	inline void insert(int x) {
		unsigned ptr = size_++; heap.push_back(x);
		while (ptr > 1) {
			if (heap[ptr >> 1] < heap[ptr]) swap(heap[ptr], heap[ptr >> 1]);
			ptr >>= 1;
		}
	}
	inline int extract() {
		int ret = heap[1]; unsigned ptr = 1;
		while ((ptr << 1) + 1 < size_) {
			ptr <<= 1;
			if (heap[ptr] > heap[ptr + 1]) swap(heap[ptr >> 1], heap[ptr]);
			else swap(heap[ptr + 1], heap[ptr >> 1]), ptr++;
		}
		heap[ptr] = heap[--size_]; , heap[size_] = 0;
		while (ptr > 1) {
			if (heap[ptr >> 1] < heap[ptr]) swap(heap[ptr], heap[ptr >> 1]);
			ptr >>= 1;
		}
		heap.pop_back();
		return ret;
	}
};
char c[9]; int v;
int main() {
    PriorityQueue<int> que;
    while(scanf("%s", c), c[3]) {
        if(*c == 'i') scanf("%d", &v), que.insert(v);
        else printf("%d\n", que.extract());
    }
}

Compiler output:
a.cc: In member function 'int PriorityQueue<T>::extract()':
a.cc:28:44: error: expected primary-expression before ',' token
   28 |                 heap[ptr] = heap[--size_]; , heap[size_] = 0;
      |                                            ^
a.cc: In function 'int main()':
a.cc:40:11: error: 'scanf' was not declared in this scope
   40 |     while(scanf("%s", c), c[3]) {
      |           ^~~~~
a.cc:42:14: error: 'printf' was not declared in this scope
   42 |         else printf("%d\n", que.extract());
      |              ^~~~~~
a.cc:3:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    2 | #include <algorithm>
  +++ |+#include <cstdio>
    3 | using namespace std;
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <deque>
#include <queue>
#include <list>
#include <stack>
#include <string>
#include <functional>
#include <numeric>
#include <cmath>
#include <iomanip>
#include <map>
#include <set>
#include <cstdlib>
#include <windows.h>
#define INF 100000000
#define _INF -100000000
#define INFLL (long long)1e14
#define _INFLL (long long)-1e14
#define Loop(i, n) for(int i = 0; i < (int)n; i++)
#define Loop1(i, n) for(int i = 1; i <= (int)n; i++)
#define Loopr(i, n) for(int i = (int)n - 1; i >= 0; i--)
#define Loopr1(i, n) for(int i = (int)n; i >= 1; i--)
using namespace std;
typedef long long int ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef pair<int, int> P;

class self_made_pq {
public:
	vi heap;
	int n, inf;
	bool ord; //true????????§??????????????????pop
	bool comp(int a, int b){
		if (ord) return a > b;
		else return a < b;
	}
public:
	self_made_pq(int N, bool b) {
		heap.resize(N * 2 - 1);
		ord = b;
		if (ord) inf = INT_MIN;
		else inf = INT_MAX;
		fill(heap.begin(), heap.end(), inf);
		n = 0;
	}
	void ins(int a) {
		heap[n] = a;
		int k1 = n, k2 = n;
		while (k2 > 0) {
			k2 = (k1 - 1) / 2;
			if (comp(heap[k1], heap[k2])) swap(heap[k1], heap[k2]);
			else break;
			k1 = k2;
		}
		n++;
	}
	int pop() {
		if (n == 0) return inf;
		int ret = heap[0];
		heap[0] = heap[n - 1];
		heap[n - 1] = inf;
		n--;
		int k1 = 0, k2 = 0;
		while (true) {
			k2 = k1 * 2 + 1;
			if (comp(heap[k2], heap[k1])) {
				if (comp(heap[k2 + 1], heap[k2])) swap(heap[k1], heap[k2 + 1]);
				else swap(heap[k1], heap[k2]);
			}
			else if (comp(heap[k2 + 1], heap[k1])) swap(heap[k1], heap[k2 + 1]);
			else break;
			k1 = k2;
		}
		return ret;
	}
};



int main() {
	self_made_pq pq(2e6, true);
	while (true) {
		string s; cin >> s;
		if (s == "end") break;
		else if (s == "extract") cout << pq.pop() << endl;
		else {
			int x; cin >> x;
			pq.ins(x);
		}
	}
	return 0;
}

Compiler output:
a.cc:16:10: fatal error: windows.h: No such file or directory
   16 | #include <windows.h>
      |          ^~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <deque>
#include <queue>
#include <list>
#include <stack>
#include <string>
#include <functional>
#include <numeric>
#include <cmath>
#include <iomanip>
#include <map>
#include <set>
#include <cstdlib>
#define INF 100000000
#define _INF -100000000
#define INFLL (long long)1e14
#define _INFLL (long long)-1e14
#define Loop(i, n) for(int i = 0; i < (int)n; i++)
#define Loop1(i, n) for(int i = 1; i <= (int)n; i++)
#define Loopr(i, n) for(int i = (int)n - 1; i >= 0; i--)
#define Loopr1(i, n) for(int i = (int)n; i >= 1; i--)
using namespace std;
typedef long long int ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef pair<int, int> P;

class self_made_pq {
public:
	vi heap;
	int n, inf;
	bool ord; //true????????§??????????????????pop
	bool comp(int a, int b){
		if (ord) return a > b;
		else return a < b;
	}
public:
	self_made_pq(int N, bool b) {
		heap.resize(N * 2 - 1);
		ord = b;
		if (ord) inf = INT_MIN;
		else inf = INT_MAX;
		fill(heap.begin(), heap.end(), inf);
		n = 0;
	}
	void ins(int a) {
		heap[n] = a;
		int k1 = n, k2 = n;
		while (k2 > 0) {
			k2 = (k1 - 1) / 2;
			if (comp(heap[k1], heap[k2])) swap(heap[k1], heap[k2]);
			else break;
			k1 = k2;
		}
		n++;
	}
	int pop() {
		if (n == 0) return inf;
		int ret = heap[0];
		heap[0] = heap[n - 1];
		heap[n - 1] = inf;
		n--;
		int k1 = 0, k2 = 0;
		while (true) {
			k2 = k1 * 2 + 1;
			if (comp(heap[k2], heap[k1])) {
				if (comp(heap[k2 + 1], heap[k2])) swap(heap[k1], heap[k2 + 1]);
				else swap(heap[k1], heap[k2]);
			}
			else if (comp(heap[k2 + 1], heap[k1])) swap(heap[k1], heap[k2 + 1]);
			else break;
			k1 = k2;
		}
		return ret;
	}
};



int main() {
	self_made_pq pq(2e6, true);
	while (true) {
		string s; cin >> s;
		if (s == "end") break;
		else if (s == "extract") cout << pq.pop() << endl;
		else {
			int x; cin >> x;
			pq.ins(x);
		}
	}
	return 0;
}

Compiler output:
a.cc: In constructor 'self_made_pq::self_made_pq(int, bool)':
a.cc:45:32: error: 'INT_MIN' was not declared in this scope
   45 |                 if (ord) inf = INT_MIN;
      |                                ^~~~~~~
a.cc:16:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   15 | #include <cstdlib>
  +++ |+#include <climits>
   16 | #define INF 100000000
a.cc:46:28: error: 'INT_MAX' was not declared in this scope
   46 |                 else inf = INT_MAX;
      |                            ^~~~~~~
a.cc:46:28: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
Language: C++

#include <cstdio>
#include <cstdlib>
#include <queue>

int main()
{
    char Line[19];
    int Value;

    std::priority_queue<int> S;
    while(1){
        std::gets(Line);
        if(Line[0] == 'i'){
            S.push(std::atoi(&Line[7]));
        }else
        if(Line[1] == 'x'){
            std::printf("%d\n", S.top());
            S.pop();
        }else{
            break;
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:14: error: 'gets' is not a member of 'std'; did you mean 'getc'?
   12 |         std::gets(Line);
      |              ^~~~
      |              getc
Language: C++

#include<iostream>
#include<vector>
#include<string>
using namespace std;
vector <int> a;
void insert(int k) {
	a.push_back(k);
	while ((k - 1 / 2) >= 0 && a[(k - 1) / 2] < a[k]) {
		swap(a[k], a[(k - 1) / 2]);
		k = (k - 1) / 2;
	}
}

int extractmax() {
	int c;
	c = a[0];
	a[0] = a.back();
	a.pop_back();
	maxheapify(0);
	cout << c << endl;
}
void maxheapify(int i) {
	int l = 2 * i + 1;
	int r = 2 * i + 2;
	int largest = i;
	if (l<(int)a.size() && a[l]>a[i]) {
		largest = l;
	}
	if (r<(int)a.size() && a[r]>a[largest]) {
		largest = r;
	}
	if (largest != i) {
		swap(a[i], a[largest]);
		maxheapify(largest);
	}
}
int main() {
	string x;
	int y;
	while (cin >> x) {
		if (x == "end") {
			return 0;
		}
		else if (x == "insert") {
			cin >> y;
			insert(y);
		}
		else if (x=="extract"){
			extractmax();
		}
	}
}

Compiler output:
a.cc: In function 'int extractmax()':
a.cc:19:9: error: 'maxheapify' was not declared in this scope
   19 |         maxheapify(0);
      |         ^~~~~~~~~~
a.cc:21:1: warning: no return statement in function returning non-void [-Wreturn-type]
   21 | }
      | ^
Language: C++

#include <cassert>
#include <cstdio>
#include <cstdlib>
#include <queue>

template<typename T>
class TBinaryHeap
{
    std::vector<T> FArray;
    void BubbleUp(int Index)
    {
        assert(FArray.size() > Index);
        if(Index == 1) return;
        int Parent = Index / 2;
        if(FArray[Index] <= FArray[Parent]){
            return;
        }
        std::swap(FArray[Index], FArray[Parent]);
        BubbleUp(Parent);
    }
    void BubbleDown(int Index)
    {
        assert(FArray.size() > Index);
        int Left  = Index * 2;
        if(Left  >= FArray.size()) return;
        int Right = Left + 1;
        const int& Target = Right >= FArray.size() ? Left : FArray[Left] > FArray[Right] ? Left : Right;
        if(FArray[Target] > FArray[Index]){
            std::swap(FArray[Index], FArray[Target]);
            BubbleDown(Target);
        }
    }
public:
    TBinaryHeap()
    {
        FArray.reserve(2000000)
        FArray.resize(1); // dummy
    }
    void push(const T& Value)
    {
        FArray.push_back(Value);
        BubbleUp(FArray.size()-1);
    }
    void pop()
    {
        assert(FArray.size() >= 1);
        FArray[1] = FArray.back();
        FArray.pop_back();
        if(FArray.size() == 1) return; // dummy???????????????
        BubbleDown(1);
    }
    const T& top()
    {
        return FArray[1];
    }
};
int main()
{
    char Line[19];
    int Value;

    // std::priority_queue<int> S;
    TBinaryHeap<int> S;
    while(1){
        std::fgets(Line, 19, stdin);
        if(Line[0] == 'i'){
            S.push(std::atoi(&Line[7]));
        }else
        if(Line[1] == 'x'){
            std::printf("%d\n", S.top());
            S.pop();
        }else{
            break;
        }
    }
    return 0;
}

Compiler output:
a.cc: In constructor 'TBinaryHeap<T>::TBinaryHeap()':
a.cc:37:9: error: expected ';' before 'FArray'
   37 |         FArray.resize(1); // dummy
      |         ^~~~~~
Language: C++

#include <cassert>
#include <cstdio>
#include <cstdlib>
#include <queue>

template<typename T>
class TBinaryHeap
{
    std::vector<T> FArray;
public:
    TBinaryHeap()
    {
        FArray.reserve(2000000);
        FArray.resize(1); // dummy
    }
    void push(const T& Value)
    {
        std::size_t Index = FArray.size();
        FArray.push_back(Value);
        std::size_t Parent;
        while(Index > 1){
            Parent = Index / 2;
            std::swap(FArray[Index], FArray[Parent]);
            Index = Parent;
        }
        BubbleUp(FArray.size()-1);
    }
    void pop()
    {
        assert(FArray.size() >= 1);
        FArray[1] = FArray.back();
        FArray.pop_back();

        std::size_t Size = FArray.size();
        std::size_t Index = 1;
        std::size_t Left, Right;
        while(Index < Size){
            Left = Index * 2;
            Right = Left + 1;
            if(Left >= Size) break;
            std::size_t Target = Right >= Size ? Left : FArray[Left] > FArray[Right] ? Left : Right;
            if(FArray[Target] <= FArray[Index]) break;
            std::swap(FArray[Index], FArray[Target]);
            Index = Target;
        }
    }
    const T& top()
    {
        return FArray[1];
    }
};
int main()
{
    char Line[19];
    int Value;

    // std::priority_queue<int> S;
    TBinaryHeap<int> S;
    while(1){
        std::fgets(Line, 19, stdin);
        if(Line[0] == 'i'){
            S.push(std::atoi(&Line[7]));
        }else
        if(Line[1] == 'x'){
            std::printf("%d\n", S.top());
            S.pop();
        }else{
            break;
        }
    }
    return 0;
}

Compiler output:
a.cc: In instantiation of 'void TBinaryHeap<T>::push(const T&) [with T = int]':
a.cc:62:19:   required from here
   62 |             S.push(std::atoi(&Line[7]));
      |             ~~~~~~^~~~~~~~~~~~~~~~~~~~~
a.cc:26:17: error: 'BubbleUp' was not declared in this scope
   26 |         BubbleUp(FArray.size()-1);
      |         ~~~~~~~~^~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <string>
#include <vector>

void Swap(std::vector<int>& Heap, int IndexA, int IndexB)
{
	int Temp = Heap[IndexA - 1];
	Heap[IndexA - 1] = Heap[IndexB - 1];
	Heap[IndexB - 1] = Temp;
}

void MinHeapify(std::vector<int>& Heap, unsigned int Index)
{
	unsigned int Left = 2 * Index;
	unsigned int Right = 2 * Index + 1;
	unsigned int Smallest;
	if(Left <= Heap.size() && Heap[Left - 1] < Heap[Index - 1]){
		Smallest = Left;
	}else{
		Smallest = Index;
	}
	
	if(Right <= Heap.size() && Heap[Right - 1] < Heap[Smallest - 1]){
		Smallest = Right;
	}
	
	if(Smallest != Index){
		Swap(Heap, Smallest, Index);
		MinHeapify(Heap, Smallest);
	}
}

void BuildMinHeap(std::vector<int>& Heap)
{
	for(unsigned int i = Heap.size() / 2; i > 0; --i){
		MinHeapify(Heap, i);
	}
}

class TPriorityQueue
{
	std::vector<int> FHeap;
public:
	void Insert(Key);
	int ExtractMax();
};

void TPriorityQueue::Insert(int Key)
{
	FHeap.push_back(Key);
}

int TPriorityQueue::ExtractMax()
{
	BuildMinHeap(FHeap);
	int Result = FHeap.back();
	FHeap.pop_back();
	return Result;
}

void Execute()
{
	TPriorityQueue Queue;
	while(1){
		std::string Command;
		std::cin >> Command;
		if(Command == "insert"){
			int Key;
			std::cin >> Key;
			Queue.Insert(Key);
		}
		if(Command == "extract"){
			std::cout << Queue.ExtractMax() << std::endl;
		}
		if(Command == "end") break;
	}
}

int main()
{
	Execute();
	return 0;
}

Compiler output:
a.cc:44:21: error: 'Key' has not been declared
   44 |         void Insert(Key);
      |                     ^~~
Language: C++

#include <iostream>
#include <string>
#include <queue>
using namespace std;

int main(void){
	std::priority_queue<int> q;
	int a;
	while(cin>>s,s[2]!='d'){
		if(s[2]=='s'){
			cin>>a;
			q.push(a);
		}else{
			cout<<q.top()<<endl;
			q.pop();
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:20: error: 's' was not declared in this scope
    9 |         while(cin>>s,s[2]!='d'){
      |                    ^
Language: C++

#include <iostream>
#include <queue>
#include <string>
using namespace std;

int main(){
  string command;
  qriority_queue<int> q;
  while(cin >> command && command!="end"){
    if(command=="insert"){
      int n;
      cin >> n;
      q.push(n);
    }else{
      cout << q.top() << endl;
      q.pop();
    }
  }

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'qriority_queue' was not declared in this scope
    8 |   qriority_queue<int> q;
      |   ^~~~~~~~~~~~~~
a.cc:8:18: error: expected primary-expression before 'int'
    8 |   qriority_queue<int> q;
      |                  ^~~
a.cc:13:7: error: 'q' was not declared in this scope
   13 |       q.push(n);
      |       ^
a.cc:15:15: error: 'q' was not declared in this scope
   15 |       cout << q.top() << endl;
      |               ^
Language: C++

#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
#define MAX 2000000
#define INFTY (1 << 30)

int H, A[MAX+1];

void maxHeapify(int i) {
	int l, r, largest;
	l = 2 * i;
	r = 2 * i + 1;
	
	if(l <= H && A[l] > A[i]) largest = l;
	else largest = i;
	if(r <= H && A[r] > A[largest]) largest = r;
	
	if(largest != i) {
		swap(A[i], A[largest]);
		maxHeapify(largest);
	}	
}

int extract() {
	int maxv;
	if(H < 1) return -INFTY;
	maxv = A[1];
    A[1] = A[H--];
	maxHeapify(1);
	return maxv;		
}

void increaseKey(int i, int key) {
	if(key < A[i]) return;
	A[i] = key;
	while(i > 1 && A[i / 2] < A[i]) {
		swap(A[i], A[i / 2]);
		i = i / 2; 
	} 
}

void insert(int key) {
	H++;
	A[H] = -INFTY;
	increaseKey(H, key);
}

int main() {
	int key;
	char com[10];
	
	while( 1 ) {
		scanf("%s", com);
		if(com[0] == 'e' && com[1] == 'n') break;
		if(com[0] == 'i') {
			scanf("%d" &key);
			insert(key);
		} else {
			printf("%d\n", extract());
		}
	}
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:57:36: error: invalid operands of types 'const char [3]' and 'int' to binary 'operator&'
   57 |                         scanf("%d" &key);
      |                               ~~~~ ^~~~
      |                               |     |
      |                               |     int
      |                               const char [3]
Language: C++

#include <iostream>
#include <vector>
#include <string>
using namespace std;

int main() {
	int n;
	int H=0;
	vector<int> A;
	vector<int>::iterator max_itr;
	string cmd;
	cin >> cmd;
	while(cmd!="end") {
		if(cmd=="insert") {
			cin >> n;
			A.push_back(n);
			//
		} else if(cmd=="extract") {
			//
			max=-1;
			for(auto itr=A.begin(); itr!=A.end(); ++itr) {
				max_itr=((*max_itr)<(*itr)?(itr):(max_itr));
			}
			cout << *max_itr << endl;
			A.erase(max_itr);
		}
		cin >> cmd;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:30: error: overloaded function with no contextual type information
   20 |                         max=-1;
      |                              ^
Language: C++

#include <iostream>
#include <vector>
#include <string>
using namespace std;

void merge(vector<int>& A, int left, int mid, int right) {
	int n1=mid-left;
	int n2=right-mid;
	int i,j,k;
	vector<int> L,R;

	L.resize(n1+1);
	R.resize(n2+1);
	for(i=0; i<n1; ++i) {
		L[i]=A[left+i];
	}
	for(i=0; i<n2; ++i) {
		R[i]=A[mid+i];
	}
	L[n1]=INT_MAX;
	R[n2]=INT_MAX;

	i=j=0;
	for(k=left; k<right; ++k) {
		A[k]=(L[i]<R[j])?L[i++]:R[j++];
	}
	return;
}

void mergeSort(vector<int>& A, int left, int right) {
	if(left+1<right) {
		int mid=left+(right-left)/2;
		mergeSort(A,left,mid);
		mergeSort(A,mid,right);
		merge(A,left,mid,right);
	}
	return;
}

int main() {
	int n;
	vector<int> A;
	vector<int>::iterator max_itr;
	string cmd;
	cin >> cmd;
	while(cmd!="end") {
		if(cmd=="insert") {
			cin >> n;
			A.push_back(n);
		} else if(cmd=="extract") {
			mergeSort(A,0,A.size());
			cout << A.back() << endl;
			A.pop_back();
		}
		cin >> cmd;
	}
	return 0;
}

Compiler output:
a.cc: In function 'void merge(std::vector<int>&, int, int, int)':
a.cc:20:15: error: 'INT_MAX' was not declared in this scope
   20 |         L[n1]=INT_MAX;
      |               ^~~~~~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    2 | #include <vector>
  +++ |+#include <climits>
    3 | #include <string>