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


#include <stdio.h>
#include <stdlib.h>

int parent(int i){
  if(i%2==0) return i/2;
  else return (i-1)/2;
}

int main(){
  int h,i;
  int *A;
  scanf("%d",&h);
  A=(int *)malloc(h * sizeof(int));
  for(i=1;i<=h;i++){
    scanf("%d",&A[i]);
  }

  for(i=1;i<=h;i++){
    printf("node %d: key = %d, ",i,A[i]);
    if(i!=1) printf("parent key = %d,",A[parent(i)]);
    if(i*2<=h) printf(" left key = %d,",A[2*i]);
    if(2*i+1<=h) printf(" right key = %d,",A[2*i+1)]);
    printf("\n");
  }
  free(A);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:23:51: error: expected ']' before ')' token
   23 |     if(2*i+1<=h) printf(" right key = %d,",A[2*i+1)]);
      |                                                   ^
      |                                                   ]
main.c:23:52: error: expected ';' before ']' token
   23 |     if(2*i+1<=h) printf(" right key = %d,",A[2*i+1)]);
      |                                                    ^
      |                                                    ;
main.c:23:52: error: expected statement before ']' token
main.c:23:53: error: expected statement before ')' token
   23 |     if(2*i+1<=h) printf(" right key = %d,",A[2*i+1)]);
      |                                                     ^
Language: C

#include<stdio.h>
#define MAX 100000
int parent(int i){return i/2;}
int left(int i){return 2*i;}
int right(int i){return 2*i+1;}
int main()
{
  int H,i,A[MAX+1];
  scanf("%d",&H);
  for(i=1;i<=H;i++)
    {
      scanf("%d",&A[i]);
    }
  for(i=1;i<=H;i++)
    {
      printf("node %d : key=%d,",i,A[i]);
      if(parent(i)>=1)
	printf("parent key=%d,",A[parent(i)]);
      
      if(left(i)<=H)
	printf("left key=%d,",A[left(i)]);
    
      if(right(i)<=H)
	printf("right key=%d,",A[right(i)]);
      
      printf("\n");
    }
  return 0;

Compiler output:
main.c: In function 'main':
main.c:28:3: error: expected declaration or statement at end of input
   28 |   return 0;
      |   ^~~~~~
Language: C

 #include<iostream>     
 #include<cstdio>       
 #include<cstdlib>      
 #include<algorithm>    
 #include<cstring>      
 using namespace std;
 int n,m;
 int main()
 {
  while(scanf("%d",&n),n)	
{
  int a[1010];
  int b[1010];
  int f[1010];
  int mmax=0;
	int maxid=0;
 	for(int i=1;i<=n;i++)
{
	scanf("%d",&a[i]);
	if(a[i]>mmax)
	{
	mmax=a[i];
	maxid=i;	
	}	
}
	a[maxid]=0;
	 scanf("%d",&m);
	 m-=5;	
 	int c[1010];
 	for(int i=1;i<=n;++i)
 		for(int j=m;j>=0;--j)
	{
	if(a[i]<=j) 
		f[j]=max(f[j],f[j-a[i]]+a[i]);
    else
  		f[j]=f[j];
 	}
 //	printf("%d\n",f[m]);
 	printf("%d\n",m+5-f[m]-mmax);
 }       
 }                                                             


Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 |  #include<iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C

#include<iostream>
#include<stdlib.h>
using namespace std;
int main(){
	int length = 0;
	int *note;
	int r = 0;
	int l = 0;
	int level = 0;
	int lastR = 1;
	int ans = 0;
	printf("your note number");
	cin >>length;
	ans = length;
	while(ans != 0){
		ans = ans/2;
		level++;
	}
	for(int i =1;i<level;i++){
		lastR = lastR*2;
	}
	//printf("level = %d lastR = %d\n",level,lastR);
		
	note = new int[length] ;
	//輸入the note 
	for(int i=1;i<=length;i++){
		cin >>  note[i] ; 
	}
			
			for(int i=1;i<=length;i++){
				r = (i*2)+1;
				l = (i*2);
				//printf("r=%d,l=%d  ",r,l);
				//printf("r = %d l = %d\n",r,l);
				if(i == 1){
					printf("key = %d, ",note[i]);
					printf("left key = %d, ",note[l]);
					printf("right key = %d,",note[r]);
				
				}
				else if(i < lastR){
					printf("key = %d, ",note[i]);
					printf("parent key = %d, ",note[i/2]);
					if(l <= length)	printf("left key = %d, ",note[l]);
					if(r <= length)  printf("right key = %d,",note[r]);
				}
				else {
					printf("key = %d, ",note[i]);
					printf("parent key = %d, ",note[i/2]);
				}
				printf("\n");
			}
		
		

	
	return 0;
}


Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C

import java.util.*;
import java.io.*;
class Main{
    static int heapSize;
    static int[] heapTree;

    public static void main(String[] args){
	Scanner sread = new Scanner(System.in);
	BufferedReader bin = new BufferedReader(new InputStreamReader(System.in));
	String line = new String();

	//read Tree
	try{
	    line = bin.readLine();
	}
	catch(IOException e){
	    System.out.println("Error");
	}
	heapSize=Integer.parseInt(line);
	heapTree = new int[heapSize+1];

	try{
	    line=bin.readLine();
	}
	catch(IOException e){
	    System.out.println("Error");
	}

	//make Tree
	String[] key = line.split(" ");
	for(int i=1; i<heapTree.length; i++){
	    heapTree[i]=Integer.parseInt(key[i-1]);
	}

	//print
	for(int i=1; i<heapTree.length; i++){
	    System.out.println("node"+i+": key = "+heapTree[i]+","+getParent(i)+getLeft(i)+getRight(i));
	}
    }

    static String getParent(int i){
	if(i/2!=0){
	    return " parent key = " + heapTree[i/2] +",";
	}
	else return "";
    }

    static String getLeft(int i){
	if(2*i<heapSize+1){
	    return " left key = "+heapTree[2*i]+",";
	}
	else return "";
    }

    static String getRight(int i){
	if(2*i+1<heapSize+1){
	    return " right key = "+heapTree[2*i+1]+",";
	}
	else return "";
    }

}

Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import java.util.*;
      | ^~~~~~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    1 | import java.util.*;
      |            ^
main.c:2:1: error: unknown type name 'import'
    2 | import java.io.*;
      | ^~~~~~
main.c:2:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    2 | import java.io.*;
      |            ^
main.c:3:1: error: unknown type name 'class'
    3 | class Main{
      | ^~~~~
main.c:3:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
    3 | class Main{
      |           ^
Language: C

#include <stdio.h>
#define MAX_N 250

int N;
int heap[MAX_N];

int main() {
  int i, parent, left, right;
  scanf("%d", &N);
  for(i = 0; i < N; ++i) {
    scanf("%d", heap+i);
  }
  for(i = 0; i < N; ++i) {
    printf("node %d: key = %d,", i+1, heap[i]);
    parent = (i-1)/2;
    left = i*2 + 1;
    right = i*2 + 2;
    if(i != 0) printf(" parent key = %d,", heap[parent]);
    if(left < N) printf(" left key = %d,", heap[left]);
    if(right < N) printf(" right key = %d,", heap[right]);
    printf("\n");
  }
  return 0;
}
#include <stdio.h>
#define MAX_N 250

int N;
int heap[MAX_N];

int main() {
  int i, parent, left, right;
  scanf("%d", &N);
  for(i = 0; i < N; ++i) {
    scanf("%d", heap+i);
  }
  for(i = 0; i < N; ++i) {
    printf("node %d: key = %d,", i+1, heap[i]);
    parent = (i-1)/2;
    left = i*2 + 1;
    right = i*2 + 2;
    if(i != 0) printf(" parent key = %d,", heap[parent]);
    if(left < N) printf(" left key = %d,", heap[left]);
    if(right < N) printf(" right key = %d,", heap[right]);
    printf("\n");
  }
  return 0;
}

Compiler output:
main.c:31:5: error: redefinition of 'main'
   31 | int main() {
      |     ^~~~
main.c:7:5: note: previous definition of 'main' with type 'int()'
    7 | int main() {
      |     ^~~~
Language: C

#include<stdio.h>
 
#define H 250
 
int main(int argc,char *argv[])
{
    int heap[H+1];
    int i, n;
 
    scanf("%d", &i);
    for(j = 1; j <= i; j++){
        scanf("%d", &heap[j]);
    }
 
    for(j = 1; j <= i; j++){
        printf("node %d: key = %d, ", j, heap[j]);
        if(0 < (j / 2)){
            printf("parent key = %d, ", heap[j / 2]);
        }
        if((2 * j) <= n){
            printf("left key = %d, ", heap[2 * j]);
        }
        if((2 * j + 1) <= i){
            printf("right key = %d, ", heap[2 * j + 1]);
        }
        printf("\n");
    }
 
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:9: error: 'j' undeclared (first use in this function)
   11 |     for(j = 1; j <= i; j++){
      |         ^
main.c:11:9: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
 
#define H 250
 
int main(int argc,char *argv[])
{
    int heap[H+1];
    int i, j;
 
    scanf("%d", &i);
    for(j = 1; j <= i; j++){
        scanf("%d", &heap[j]);
    }
 
    for(j = 1; j <= i; j++){
        printf("node %d: key = %d, ", j, heap[j]);
        if(0 < (j / 2)){
            printf("parent key = %d, ", heap[j / 2]);
        }
        if((2 * j) <= n){
            printf("left key = %d, ", heap[2 * j]);
        }
        if((2 * j + 1) <= i){
            printf("right key = %d, ", heap[2 * j + 1]);
        }
        printf("\n");
    }
 
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:20:23: error: 'n' undeclared (first use in this function)
   20 |         if((2 * j) <= n){
      |                       ^
main.c:20:23: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<Stdio.h>
#define M 250

int parent(int i){
    return i/2;
}
int Left(int i){
    return 2*i;
}
int Right(int i){
    return 2*i+1;
}

int main(void){
    int i;
    int n;
    int heap[M];
    scanf("%d",&n);
    for(i=1;i<n+1;i++){
        scanf("%d",&heap[i]);
    }
    
    for(i=1;i<n+1;i++){
        if(i==1)printf("node %d: key = %d, ",i,heap[i]);
        else if(i>1)printf("node %d: key = %d, parent key = %d, ",i,heap[i],heap[parent(i)]);
        
        if(Left(i)<=n)printf("left key = %d, ",heap[Left(i)]);
        if(Right(i)<=n)printf("right key = %d, ",heap[Right(i)]);
        printf("\n");
            
            }
                             return 0;
}

Compiler output:
main.c:1:9: fatal error: Stdio.h: No such file or directory
    1 | #include<Stdio.h>
      |         ^~~~~~~~~
compilation terminated.
Language: C

#include <stdio.h>
#include <stdlib.h>
#define N 255 //ヒープの個数
 
int Parent(int i){ //親のアドレス番号ッスね
  return i/2;
}
 
int Left(int i){　//左側の子のアドレス番号ッス
  return 2*i;
}
 
int Right(int i){ //右側の子のアドレス番号ッス
  return 2*i+1;
}
 
int check(int n,int i){//プリントするパターンをここで分岐させるッス
  if(n>=Right(i)) return 1;//左側と右側の子供がいる
  else if(n>=Left(i) && n<Right(i)) return 2;//左の子供は居るけど、右側の子供がいない
  else if(n<Left(i)) return 3;//左側すらないのか…（困惑）
}
 
main(){
  int n,i;
  int A[N];
 
  scanf("%d",&n);//スキャンする個数ッス
 
  for(i=1;i<=n;i++){//for文回して頭も回すで！
	 scanf("%d",&A[i]);
 }

  for(i=1;i<=n;i++){//for文回してプリントするやでー
    if(i==1){//最初は親無いから場合分けするやでー
      if(check(n,i)==1) printf("node %d: key = %d, left key = %d, right key = %d, \n",i,A[i],A[Left(i)],A[Right(i)]);
      else if(check(n,i)==2) printf("node %d: key = %d, left key = %d, \n",i,A[i],A[Left(i)]);
      else if(check(n,i)==3) printf("node %d: key = %d, \n",i,A[i]);
    }
    else{//一番最初以外はこの３つのパターンでプリントするやでー
      if(check(n,i)==1) printf("node %d: key = %d, parent key = %d, left key = %d, right key = %d, \n",i,A[i],A[Parent(i)],A[Left(i)],A[Right(i)]);
      else if(check(n,i)==2) printf("node %d: key = %d, parent key = %d, left key = %d, \n",i,A[i],A[Parent(i)],A[Left(i)]);
      else if(check(n,i)==3)printf("node %d: key = %d, parent key = %d, \n",i,A[i],A[Parent(i)]);
    }
  }
 
  return 0;
}

Compiler output:
main.c: In function 'Left':
main.c:9:17: error: stray '\343' in program
    9 | int Left(int i){<U+3000>//<U+5DE6><U+5074><U+306E><U+5B50><U+306E><U+30A2><U+30C9><U+30EC><U+30B9><U+756A><U+53F7><U+30C3><U+30B9>
      |                 ^~~~~~~~
main.c: At top level:
main.c:23:1: error: return type defaults to 'int' [-Wimplicit-int]
   23 | main(){
      | ^~~~
Language: C

  1 #include<stdio.h>
  2 #include<stdlib.h>
  3 
  4 int main(void){
  5         int size;
  6         int *A;
  7         int i;
  8 
  9         scanf("%d",&size);
 10 
 11         A=(int*)malloc(sizeof(int)*(size+1));
 12 
 13         for(i=1;i<=size;i++) scanf("%d",&A[i]);
 14 
 15         for(i=1;i<=size;i++){
 16                 printf("node %d: ",i);
 17                 printf("key = %d, ",A[i]);
 18                 if(i/2 > 0) printf("parent key = %d, ",A[i/2]);
 19                 if(2*i <= size) printf("left key = %d, ",A[2*i]);
 20                 if(2*i+1 <= size) printf("right key = %d, ",A[2*i+1]);
 21                 printf("\n");
 22         }
 23 
 24         return 0;
 25 }
~                                                                                             
~                                                                                             
~                                                                                             
~                                                                                             
~                                                                                             
~                         

Compiler output:
main.c:1:3: error: expected identifier or '(' before numeric constant
    1 |   1 #include<stdio.h>
      |   ^
main.c:1:5: error: stray '#' in program
    1 |   1 #include<stdio.h>
      |     ^
main.c:2:5: error: stray '#' in program
    2 |   2 #include<stdlib.h>
      |     ^
main.c:26:1: error: expected identifier or '(' before '~' token
   26 | ~
      | ^
Language: C

#include<stdio.h>
#define N 500
#define NIL -2000000001
typedef struct{
  int k, p, l, r;
} node;

node A[N];

int main(){
  int hs, i;
  scanf("%d", &hs); 
  for(i = 1; i <= N; i++){
    A[i].k = NIL;
    A[i].p = NIL;
    A[i].l = NIL;
    A[i].r = NIL;
  }
  for(i = 1; i <= hs; i++){
    scanf("%d", &A[i].k);
  }
  for(i = 1; i <= hs; i++){
    if(i != 1) A[i].p = A[i/2].k;
    if(A[2*i].) A[i].l = A[2*i].k;
    if(A[2*i+1].k != NIL) A[i].r = A[2*i+1].k;
  }
  for(i = 1; i <= hs; i++){
    printf("node %d: key = %d, ", i, A[i].k);
    if(A[i].p != NIL) printf("parent key = %d, ", A[i].p);
    if(A[i].l != NIL) printf("left key = %d, ", A[i].l);
    if(A[i].r != NIL) printf("right key = %d, ", A[i].r);
    printf("\n");
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:24:15: error: expected identifier before ')' token
   24 |     if(A[2*i].) A[i].l = A[2*i].k;
      |               ^
Language: C

#include <stdio.h>
#define N 250

main(){
  int i, n, H[N];
  scanf("%d",&n);
  for(i=1;i<n+1;i++){
    scanf("%d",&H[i]);
  }
  for(i=1;i<n+1;i++){
    if(i==1) {
      printf("node %d: key = %d, ", i, H[i]);
    }
    else(i > 1){
      printf("node %d: key = %d, parent key = %d, ", i, H[i], H[parent(i)]);
      }
    if(left(i) <= n){
      printf("left key = %d, ", H[left(i)]);
    }
    if(right(i) <= n){
      printf("right key = %d", H[right(i)]);
    }
    printf("\n");
  }
   
  return 0;   
}

int parent(int i){
  return i/2;
}

int left(int i){
  return 2*i;
}

int right(int i){
  return 2*i+1;
}   

Compiler output:
main.c:4:1: error: return type defaults to 'int' [-Wimplicit-int]
    4 | main(){
      | ^~~~
main.c: In function 'main':
main.c:14:16: error: expected ';' before '{' token
   14 |     else(i > 1){
      |                ^
      |                ;
Language: C

#include <stdio.h>
#define N 250

main(){
  int i, n, H[N];
  scanf("%d",&n);
  for(i=1;i<n+1;i++){
    scanf("%d",&H[i]);
  }
  for(i=1;i<n+1;i++){
    if(i==1) {
      printf("node %d: key = %d, ", i, H[i]);
    }
    else if(i>1) {
      printf("node %d: key = %d, parent key = %d, ", i, H[i], H[parent(i)]);
      }
    if(left(i) <= n){
      printf("left key = %d, ", H[left(i)]);
    }
    if(right(i) <= n){
      printf("right key = %d", H[right(i)]);
    }
    printf("\n");
  }
   
  return 0;   
}

int parent(int i){
  return i/2;
}

int Left(int i){
  return 2*i;
}

int Right(int i){
  return 2*i+1;
}   

Compiler output:
main.c:4:1: error: return type defaults to 'int' [-Wimplicit-int]
    4 | main(){
      | ^~~~
main.c: In function 'main':
main.c:15:65: error: implicit declaration of function 'parent' [-Wimplicit-function-declaration]
   15 |       printf("node %d: key = %d, parent key = %d, ", i, H[i], H[parent(i)]);
      |                                                                 ^~~~~~
main.c:17:8: error: implicit declaration of function 'left' [-Wimplicit-function-declaration]
   17 |     if(left(i) <= n){
      |        ^~~~
main.c:20:8: error: implicit declaration of function 'right' [-Wimplicit-function-declaration]
   20 |     if(right(i) <= n){
      |        ^~~~~
Language: C

#include<stdio.h>
#include<stdlib.h>

#define N 1000001
#define nil NULL

int parent(int i){
  return k = i/2;
}

int left(int i){
  return 2*i;
}

int right(int i){
  return 2*i+1;
}

int n;
int main(){
  int i,key;
  scanf("%d",&n);
  int A[n];
  for(i=1;i<=n;i++){
    scanf("%d",&key);
    A[i] = key;
  }
  for(i=1;i<=n;i++){
    printf("node %d: key = %d, ",i,A[i]);
    if(i!=1) printf("parent key = %d, ",A[parent(i)]);
    if(2*i<= n) printf("left key = %d, ",A[left(i)]);
    if(2*i+1<=n) printf("right key = %d, ",A[right(i)]);
    printf("\n");
  }
}

Compiler output:
main.c: In function 'parent':
main.c:8:10: error: 'k' undeclared (first use in this function)
    8 |   return k = i/2;
      |          ^
main.c:8:10: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
#include<stdlib.h>

#define N 1000001
#define nil NULL

int parent(int i){
  return k = i/2;
}

int left(int i){
  return 2*i;
}

int right(int i){
  return 2*i+1;
}

int n;
int main(){
  int i,key;
  scanf("%d",&n);
  int A[n];
  for(i=1;i<=n;i++){
    scanf("%d",&key);
    A[i] = key;
  }
  for(i=1;i<=n;i++){
    printf("node %d: key = %d, ",i,A[i]);
    if(i!=1) printf("parent key = %d, ",A[parent(i)]);
    if(2*i<= n) printf("left key = %d, ",A[left(i)]);
    if(2*i+1<=n) printf("right key = %d, ",A[right(i)]);
    printf("\n");
  }
  return 0;
}

Compiler output:
main.c: In function 'parent':
main.c:8:10: error: 'k' undeclared (first use in this function)
    8 |   return k = i/2;
      |          ^
main.c:8:10: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

//
//  9_A.cpp
//  
//
//  Created by 杵鞭俊 on 2018/07/13.
//

#include<iostream>
using namespace std;
#define MAX 100000

int parent(int i) {return i/2;}
int left(int i){return 2 * i;}
int right(int i){return 2 * i + 1;}

int main(){
    int H,i,A[MAX + 1];
    
    cin >> H;
    for(i=1;i<=H;i++) cin >> A[i];
    
    for(i=1;i<=H;i++){
        cout << "node " << i << ": key = " << A[i] << ", ";
        if(parent(i) >= 1)cout << "parent key = " << <<A[parent(i)] << ", ";
        if(left(i) <= H) cout << "left key = " << A[left(i)] << ", ";
        if(right(i) <= H) cout << "right key = " << A[right(i)] << ", ";
        cout << endl;
    }
    
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:24:54: error: expected primary-expression before '<<' token
   24 |         if(parent(i) >= 1)cout << "parent key = " << <<A[parent(i)] << ", ";
      |                                                      ^~
Language: C++

#include <iostream>
using namespace std;
#define MAX 100000;

int parent(int i){
	return i/2;	
}
int left(int i){
	return i*2;
}
int right(int i){
	return (i*2+1);
}


int main(){
int H,i,A[MAX+1];
	
	for(i=1;i<=H;i++){
		cin >> A[i];
	}
	
	for(i=1;i<=H;i++){
		cout << "node " << i << ": key = " << A[i] << ", ";
		if(parent(i) >= 1) cout << "parent key = " << A[parent(i)] << ", ";
		if(left(i) <= H) cout << "left key = " << A[left(i)] << ", ";
		if(right(i) <= H) cout << "right key = " << A[right(i)] << ", "
		cout << endl;
	}	
	
return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:3:19: error: expected ']' before ';' token
    3 | #define MAX 100000;
      |                   ^
a.cc:17:11: note: in expansion of macro 'MAX'
   17 | int H,i,A[MAX+1];
      |           ^~~
a.cc:17:16: error: expected ';' before ']' token
   17 | int H,i,A[MAX+1];
      |                ^
      |                ;
a.cc:20:24: error: 'A' was not declared in this scope
   20 |                 cin >> A[i];
      |                        ^
a.cc:24:55: error: 'A' was not declared in this scope
   24 |                 cout << "node " << i << ": key = " << A[i] << ", ";
      |                                                       ^
Language: C++

#include<iostream>
using namespace std;
#define MAX 100000

int parent(int i){return i/2;}
int left(int i){return 2*1;}
int right(int i){return 2*i+1;}

int main(){
  int H,i A[MAX+1];

  cin>>H;
  for(i=1;i<=H;i++) cin>>A[i];

  for(i=1;i<=H;i++){
    cout<<"node "<<i<<": key = "<<A[i]<<", ";
    if(parent(i)>=1) cout<<"parent key = "<<A[parent(i)]<<", ";
    if(left(i)<=H) cout<<"left key = "<<A[left(i)]<<", ";
    if(right(i)<=H) cout<<"right key = "<<A[right(i)]<<", ";
    cout<<endl;
  }
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:10:11: error: expected initializer before 'A'
   10 |   int H,i A[MAX+1];
      |           ^
a.cc:13:7: error: 'i' was not declared in this scope
   13 |   for(i=1;i<=H;i++) cin>>A[i];
      |       ^
a.cc:13:26: error: 'A' was not declared in this scope
   13 |   for(i=1;i<=H;i++) cin>>A[i];
      |                          ^
a.cc:15:7: error: 'i' was not declared in this scope
   15 |   for(i=1;i<=H;i++){
      |       ^
a.cc:16:35: error: 'A' was not declared in this scope
   16 |     cout<<"node "<<i<<": key = "<<A[i]<<", ";
      |                                   ^
Language: C++

#include <iostream>
#define MAX 100000

using namespace std;

void print(int i, int *A){
    cout << "node " << i << ": ";
    cout << "key = " << A[i] << ", ";
    if(i > 1) cout << "parent key = " << A[i/2] << ", ";
    if(2 * i  <= h) cout << "left key = " << A[2*i] << ", ";
    if(2 * i + 1 <= h) cout << "right key = " << A[2*i+1] << ", ";
}

int main(){
    int h, i, A[MAX+1];
    cin >> h;
    for(i = 1; i <= h; i++) cin >> A[i];
    for(i = 1; i <= h; i++){
        print(i, A);
        cout << endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'void print(int, int*)':
a.cc:10:18: error: 'h' was not declared in this scope
   10 |     if(2 * i  <= h) cout << "left key = " << A[2*i] << ", ";
      |                  ^
a.cc:11:21: error: 'h' was not declared in this scope
   11 |     if(2 * i + 1 <= h) cout << "right key = " << A[2*i+1] << ", ";
      |                     ^
Language: C++

#include<stdio.h>
#include<iostream>
using namespace std;
int main(){
long long int heap[300];
int size;
scanf("%d",&size);
for(int i=1;i<=size;i++) scanf(“%d”, heap[i]);
for(int i=1;i<=size;i++){
printf("node %d: key = %d, ",i,heap[i]);
if(i/2>0)printf("parent key = %d, ",heap[i/2]);
if(i*2<=size) printf("left key = %d, ",heap[i*2]);
if(i*2+1<=size)printf("right key = %d, ",heap[i*2+1]);
printf("\n");
}

return 0;
}


Compiler output:
a.cc:8:32: error: extended character “ is not valid in an identifier
    8 | for(int i=1;i<=size;i++) scanf(“%d”, heap[i]);
      |                                ^
a.cc:8:34: error: extended character ” is not valid in an identifier
    8 | for(int i=1;i<=size;i++) scanf(“%d”, heap[i]);
      |                                  ^
a.cc: In function 'int main()':
a.cc:8:32: error: '\U0000201c' was not declared in this scope
    8 | for(int i=1;i<=size;i++) scanf(“%d”, heap[i]);
      |                                ^
a.cc:8:34: error: 'd\U0000201d' was not declared in this scope
    8 | for(int i=1;i<=size;i++) scanf(“%d”, heap[i]);
      |                                  ^~
Language: C++

#include<stdio.h>
#define MAX 100000

int parent(int i){
return i/2;
}

int left(int i){
return 2*i;
}

int right(int i){
return 2*i+1;
}

int main(void){

int n,i,A[MAX+1];
	
scanf("%d",&n);
for(i=1;i<=n;i++){
scanf("%d",&A[i]);	
}	
for(i=1;i<=n;i++){
printf("node %d: key = %d, "i,A[i]);
if(parent(i)>=1){
printf("parent key = %d, ",A[parent(i)]);
}
if(left(i)<=n){
printf("left key = %d, ",A[left(i)]);
}
if(right(i)<=n){
printf("right key = %d, ",A[right(i)]);
}
printf("?\n");
}

return 0;
}
morimurakaito-no-MacBook-Pro:algo kaito$ 

Compiler output:
a.cc: In function 'int main()':
a.cc:25:8: error: unable to find string literal operator 'operator""i' with 'const char [20]', 'long unsigned int' arguments
   25 | printf("node %d: key = %d, "i,A[i]);
      |        ^~~~~~~~~~~~~~~~~~~~~~
a.cc: At global scope:
a.cc:40:1: error: 'morimurakaito' does not name a type
   40 | morimurakaito-no-MacBook-Pro:algo kaito$
      | ^~~~~~~~~~~~~
Language: C++

#include<stdio.h>
#define MAX 100000

int parent(int i){
return i/2;
}

int left(int i){
return 2*i;
}

int right(int i){
return 2*i+1;
}

int main(void){

int n,i,A[MAX+1];
	
scanf("%d",&n);
for(i=1;i<=n;i++){
scanf("%d",&A[i]);	
}	
for(i=1;i<=n;i++){
printf("node %d: key = %d, "i,A[i]);
if(parent(i)>=1){
printf("parent key = %d, ",A[parent(i)]);
}
if(left(i)<=n){
printf("left key = %d, ",A[left(i)]);
}
if(right(i)<=n){
printf("right key = %d, ",A[right(i)]);
}
printf("?\n");
}

return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:8: error: unable to find string literal operator 'operator""i' with 'const char [20]', 'long unsigned int' arguments
   25 | printf("node %d: key = %d, "i,A[i]);
      |        ^~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include<iostream>
using namespace std;
#define MAX 100000

int parent(int i) { return i / 2; }
int left(int i) { return 2*i; }
int right(int i ) { return 2*i +1;}

int main() {
  int H, i, A[MAX + 1];
  //1-origin
  cin >> H;
  for ( i = 1; i <= H; i++) cin >> A[i];

  for(i = 1; i <= H; i++) {
    cout << "node " << i << ": key = " << A[i] << ",";
    if(parent(i) >= 1)cout << "parent key = " << A[parent[i]] << ",";
    if(left(i) <= H)cout << "left key = " << A[left[i]] << ",";
    if(right(i) <= H)cout << "right key = " << A[right[i]] << ",";
    cout << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:60: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   17 |     if(parent(i) >= 1)cout << "parent key = " << A[parent[i]] << ",";
      |                                                            ^
a.cc:17:51: error: invalid types 'int [100001][int(int)]' for array subscript
   17 |     if(parent(i) >= 1)cout << "parent key = " << A[parent[i]] << ",";
      |                                                   ^
a.cc:18:52: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   18 |     if(left(i) <= H)cout << "left key = " << A[left[i]] << ",";
      |                                                    ^
a.cc:19:55: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   19 |     if(right(i) <= H)cout << "right key = " << A[right[i]] << ",";
      |                                                       ^
Language: C++

def parent(i):
    return int(i/2)

def left(i):
    return 2*i

def right(i):
    return 2*i + 1

def main():
    H = int(raw_input())
    A = map(int,raw_input().split())
    for i in xrange(1,H+1):
        print "node {}: key = {},".format(i, A[i-1]),
        if parent(i) >= 1: 
            print "parent key = {},".format(A[parent(i)-1]),
        if left(i) <= H: 
            print "left key = {},".format(A[left(i)-1]),
        if right(i) <= H:
            print "right key = {},".format(A[right(i)-1]),
        print
    return 0

main()

        
        

Compiler output:
a.cc:1:1: error: 'def' does not name a type
    1 | def parent(i):
      | ^~~
Language: C++

#include <iostream>
using namespace std;
const int MAX = 1000000;

int parent(int i){ return i/2 ;}
int left(int i){return 2*i;}
int right(int i){return 2*i +1;}

int main(){
    int H,i,A[MAX+1];
    cin >> H;
    for (int i = 1; i <= H ; ++i) {
        cin >> A[i];
    }
    for (int i = 1; i <= H ; ++i) {
        cout << "node " << i << ": key = " << A[i] << ", ";
        if(parent(i) >= 1) cout << "parent Key = " << A[parent(i)] << ", ";
        if(left(i) <= H) cout << "left Key = " << A[left(i)] << ", ";
        if(right(i) <= H) cout << "right Key = " << A[right(i)] << ", ";
        cout << endl;
    }
    return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:22:14: error: expected '}' at end of input
   22 |     return 0;
      |              ^
a.cc:9:11: note: to match this '{'
    9 | int main(){
      |           ^
Language: C++

#include <iostream>
#include <algorithm>
#include <string>

using namespace std;

const int s = 251;

int parent(int i) { return floor(i / 2); }
int left(int i) { return 2 * i; }
int right(int i) { return 2 * i + 1; }

// MAIN FUNCTION
int main(int argc, char** argv)
{
	int heap[s];
	// Input
	int n;
	cin >> n;
	for (int i = 1; i <= n; i++) {
		cin >> heap[i];
	}

	// Output
	for (int i = 1; i <= n; i++) {
		cout << "node " << i << ":";
		cout << " key = " << heap[i] << ",";
		if (parent(i) >= 1) cout << " parent key = " << heap[parent(i)] << ",";
		if (left(i) <= n) cout << " left key = " << heap[left(i)] << ",";
		if (right(i) <= n) cout << " right key = " << heap[right(i)] << ",";
		cout << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int parent(int)':
a.cc:9:28: error: 'floor' was not declared in this scope
    9 | int parent(int i) { return floor(i / 2); }
      |                            ^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define MAX 100000

int parent(int);
int left(int);
int right(int);

//int B;

int main(){
  int i,B;
  int A[MAX+1];
  cin >> B;
  for(i = 1; i <= B; i++){
    cin >> A[i];
  }
  for(i = 1; i <= B; i++){
    printf("node %d: key = %d, ",i,A[i]);
    if(1 <= parent(i)){
      printf("parent key = %d, ",A[parent(i)]);
    }
    if(left(i) <= B){

Compiler output:
a.cc: In function 'int main()':
a.cc:23:22: error: expected '}' at end of input
   23 |     if(left(i) <= B){
      |                     ~^
a.cc:23:22: error: expected '}' at end of input
a.cc:18:26: note: to match this '{'
   18 |   for(i = 1; i <= B; i++){
      |                          ^
a.cc:23:22: error: expected '}' at end of input
   23 |     if(left(i) <= B){
      |                      ^
a.cc:11:11: note: to match this '{'
   11 | int main(){
      |           ^
Language: C++

#include <isotream>
using namespace std;

int main(){
  cin>>a;
  for(int i=0;i<a;i++){
    cin>>s[i];
  }
  for(int i=0;i<a;i++){
    cout<<"node "<<i<<": key = "<<s[i]<<", ";
    if(i/2>=1)cout<<"parent key = "<<s[i/2]<<", ";
    if(i*2<=a)cout<<"left key = "<<s[2*i]<<", ";
    if(i*2+1<=a)cout<<"right key = "<<s[i*2+1]<<", ";
  }
  return 0;
}

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

#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
using namespace std;
int parent(int i) return i/2;
int left(int i) return 2*i;
int right(int i) return 2*i+1;
int main(){
  int H,A[250];
  scanf("%d",&H);
  REP(i,H) scanf("%d",&A[i]);
  REP(i,H){
    printf("node %d: key = %d, ",i+1,A[i]);
    if(parent(i)>=1) {
      printf("parent key = %d, ",A[parent(i+1)-1]);
    }
    if(left(i)<=H) {
      printf("left key = %d, ",A[left(i+1)-1]);
    }
    if(right(i)<=H) {
      printf("right key = %d, ",A[right(i+1)-1]);
    }
    printf("\n");
  }
  return 0;
}

Compiler output:
a.cc: In function 'int parent(int)':
a.cc:4:19: error: named return values are no longer supported
    4 | int parent(int i) return i/2;
      |                   ^~~~~~
a.cc:16:13: error: invalid initialization of reference of type 'std::ios_base&' from expression of type 'int'
   16 |     if(left(i)<=H) {
      |             ^
In file included from /usr/include/c++/14/streambuf:43,
                 from /usr/include/c++/14/bits/streambuf_iterator.h:35,
                 from /usr/include/c++/14/iterator:66,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54,
                 from a.cc:1:
/usr/include/c++/14/bits/ios_base.h:1062:18: note: in passing argument 1 of 'std::ios_base& std::left(ios_base&)'
 1062 |   left(ios_base& __base)
      |        ~~~~~~~~~~^~~~~~
a.cc:17:40: error: invalid initialization of non-const reference of type 'std::ios_base&' from an rvalue of type 'int'
   17 |       printf("left key = %d, ",A[left(i+1)-1]);
      |                                       ~^~
/usr/include/c++/14/bits/ios_base.h:1062:18: note: in passing argument 1 of 'std::ios_base& std::left(ios_base&)'
 1062 |   left(ios_base& __base)
      |        ~~~~~~~~~~^~~~~~
a.cc:19:14: error: invalid initialization of reference of type 'std::ios_base&' from expression of type 'int'
   19 |     if(right(i)<=H) {
      |              ^
/usr/include/c++/14/bits/ios_base.h:1070:19: note: in passing argument 1 of 'std::ios_base& std::right(ios_base&)'
 1070 |   right(ios_base& __base)
      |         ~~~~~~~~~~^~~~~~
a.cc:20:42: error: invalid initialization of non-const reference of type 'std::ios_base&' from an rvalue of type 'int'
   20 |       printf("right key = %d, ",A[right(i+1)-1]);
      |                                         ~^~
/usr/include/c++/14/bits/ios_base.h:1070:19: note: in passing argument 1 of 'std::ios_base& std::right(ios_base&)'
 1070 |   right(ios_base& __base)
      |         ~~~~~~~~~~^~~~~~
Language: C++

#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
using namespace std;
int parent(int i) {return i/2};
int left(int i) {return 2*i};
int right(int i) {return 2*i+1};
int main(){
  int H,A[250];
  scanf("%d",&H);
  REP(i,H) scanf("%d",&A[i]);
  REP(i,H){
    printf("node %d: key = %d, ",i+1,A[i]);
    if(parent(i)>=1) {
      printf("parent key = %d, ",A[parent(i+1)-1]);
    }
    if(left(i)<=H) {
      printf("left key = %d, ",A[left(i+1)-1]);
    }
    if(right(i)<=H) {
      printf("right key = %d, ",A[right(i+1)-1]);
    }
    printf("\n");
  }
  return 0;
}

Compiler output:
a.cc: In function 'int parent(int)':
a.cc:4:30: error: expected ';' before '}' token
    4 | int parent(int i) {return i/2};
      |                              ^
      |                              ;
a.cc: In function 'int left(int)':
a.cc:5:28: error: expected ';' before '}' token
    5 | int left(int i) {return 2*i};
      |                            ^
      |                            ;
a.cc: In function 'int right(int)':
a.cc:6:31: error: expected ';' before '}' token
    6 | int right(int i) {return 2*i+1};
      |                               ^
      |                               ;
Language: C++

#include <iostream>
using namespace std;
int main(){
        int N;
        int heap[250];
        cin >> N;
        for(int i=1 ; i<=N ; i++ )
                cin >> heap[i];
        for(int i=1 ; i<=N ; i++ ){
                int left=i*2;
                int right=i*2+1;
                int parent=i/2;
                cout<<"node "<<i<<": key = "<<heap[i];
                if(i!=1)
                        cout<<", parent key = "<<heap[parent];
                if(left<=N)
                        cout<<", left key = "<<heap[left];
                if(right<=N)
                        cout<<", right key = "<<heap[right];
                cout<<", "<<endl;
        }
}
torto


Compiler output:
a.cc:23:1: error: 'torto' does not name a type
   23 | torto
      | ^~~~~
Language: C++

import sys
import numpy as np

def BinaryTree(array):
    for i in range(1,len(array)):
        print("node " + str(i) + ": key = " + str(array[i]),end="")
        if(i != 1):
             print(", parent key = " + str(array[int(i / 2)]),end="")
        if(2*i < len(array)):
            print(", left key = " + str(array[2*i]),end = "")
        if(2*i + 1 < len(array)):
            print(", right key = " + str(array[2 * i + 1]),end = "")
        print(", ")


if __name__ == "__main__":
    h = input()
    array = [1]
    array[0] = 0
    array.extend(list(map(int,input().split())))
    #print(array)
    #array = np.array(array)
    #print(array.shape)
    BinaryTree(array)



Compiler output:
a.cc:21:6: error: invalid preprocessing directive #print
   21 |     #print(array)
      |      ^~~~~
a.cc:22:6: error: invalid preprocessing directive #array
   22 |     #array = np.array(array)
      |      ^~~~~
a.cc:23:6: error: invalid preprocessing directive #print
   23 |     #print(array.shape)
      |      ^~~~~
a.cc:1:1: error: 'import' does not name a type
    1 | import sys
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include<iostream>
using namespace std;

int parent(int i)   return i/2;
int left(int i)     return 2*i;
int right(int i)    return 2*i+1;

int main(){
    int H;
    cin >> H;
    int A[H+1];
    for(int i = 1; i <= H; i++) cin >> A[H];
    
    for(int i = 1; i <= H; i++){
        cout << "node " << i << ": key = " << A[i] << ", ";
        if(parent(i) >= 1)  cout << "parent key = " << A[parent(i)] << ", ";
        if(left(i) <= H)    cout << "left key = " << A[left(i)] << ", ";
        if(right(i) <= H)    cout << "right key = " << A[right(i)] << ", ";
        cout << endl;
    }
    
    return 0;
}


Compiler output:
a.cc: In function 'int parent(int)':
a.cc:4:21: error: named return values are no longer supported
    4 | int parent(int i)   return i/2;
      |                     ^~~~~~
a.cc:17:17: error: invalid initialization of reference of type 'std::ios_base&' from expression of type 'int'
   17 |         if(left(i) <= H)    cout << "left key = " << A[left(i)] << ", ";
      |                 ^
In file included from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/ios_base.h:1062:18: note: in passing argument 1 of 'std::ios_base& std::left(ios_base&)'
 1062 |   left(ios_base& __base)
      |        ~~~~~~~~~~^~~~~~
a.cc:17:61: error: invalid initialization of reference of type 'std::ios_base&' from expression of type 'int'
   17 |         if(left(i) <= H)    cout << "left key = " << A[left(i)] << ", ";
      |                                                             ^
/usr/include/c++/14/bits/ios_base.h:1062:18: note: in passing argument 1 of 'std::ios_base& std::left(ios_base&)'
 1062 |   left(ios_base& __base)
      |        ~~~~~~~~~~^~~~~~
a.cc:18:18: error: invalid initialization of reference of type 'std::ios_base&' from expression of type 'int'
   18 |         if(right(i) <= H)    cout << "right key = " << A[right(i)] << ", ";
      |                  ^
/usr/include/c++/14/bits/ios_base.h:1070:19: note: in passing argument 1 of 'std::ios_base& std::right(ios_base&)'
 1070 |   right(ios_base& __base)
      |         ~~~~~~~~~~^~~~~~
a.cc:18:64: error: invalid initialization of reference of type 'std::ios_base&' from expression of type 'int'
   18 |         if(right(i) <= H)    cout << "right key = " << A[right(i)] << ", ";
      |                                                                ^
/usr/include/c++/14/bits/ios_base.h:1070:19: note: in passing argument 1 of 'std::ios_base& std::right(ios_base&)'
 1070 |   right(ios_base& __base)
      |         ~~~~~~~~~~^~~~~~
Language: C++

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

int parent(int i){return i/2;}
int left(int i){return i*2;}
int right(int i){return i*2+1;}

int main(){
  int H,i,A[MAX+1];
  cin>>H;
  for(int i=1;i<=H;i++){
    cin>> A[i];
  }
  for(int i=1;i<=H;i++){
    cout << "node" << i << ": key= " << A[i] << ", ";
    if(parent(i)>=1) cout << "parent key = " << A[parent(i)] <<", ";
    if(left(i)<=H) cout << "left key = " << A[left(i)] <<", ";
    if(right(i)<=H) cout << "right key = " << A[right(i)] <<", ";
    cout << endl;
  }
  return 0;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:12:13: error: 'MAX' was not declared in this scope
   12 |   int H,i,A[MAX+1];
      |             ^~~
a.cc:15:11: error: 'A' was not declared in this scope
   15 |     cin>> A[i];
      |           ^
a.cc:18:41: error: 'A' was not declared in this scope
   18 |     cout << "node" << i << ": key= " << A[i] << ", ";
      |                                         ^
Language: Java

n = int(input())
tree = list(map(int, input().split()))

def main() :
    createHeap(n)
    print('', ' '.join(map(str, tree)))

def createHeap(x):
    for i in range((x - 1) // 2, -1, -1) :
        maxHeap(i)

def maxHeap(i) :
    if i * 2 + 1 >= n:
        return

    tmp = i * 2 + 1

    if i * 2 + 2 < n :
        if tree[i * 2 + 1] < tree[i * 2 + 2] :
            tmp = i * 2 + 2

    if tree[i] < tree[tmp] :
        tree[i], tree[tmp] = tree[tmp], tree[i]
        maxHeap(tmp)

if __name__ == '__main__':
    main()



Compiler output:
Main.java:1: error: class, interface, enum, or record expected
n = int(input())
^
Main.java:6: error: empty character literal
    print('', ' '.join(map(str, tree)))
          ^
Main.java:26: error: unclosed character literal
if __name__ == '__main__':
               ^
Main.java:26: error: unclosed character literal
if __name__ == '__main__':
                        ^
4 errors
Language: Java

import java.util.Scanner;
import java.io.IOException;
class Main {
  	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int H = scan.nextInt();
		int[] A = new int[H];
		
		for(int i = 0; i < H; i++){
			A[i] = scan.nextInt();
		}
		buildMaxHeap(A);
		for(int i= 0; i < H; i++){
			if(i != H - 1){
				System.out.print(" " + A[i]);
			}else{
				System.out.println(" " + A[i]);
			}
		}
		System.out.println();
	}
	
	public static void maxHeapify(int[] A, int i){
		int l = (i + 1) * 2 - 1;
		int r = (i + 1) * 2; 
		
		//????????????????????????????????§???????????§????????????????????¶
		int large = i;
		if(l < A.length && A[l] > A[i]) large = l;
		if(r < A.length && A[r] > A[large]) large = r;
		
		if(large != i){???//i?????????????????§????????´???
			int temp = A[i];
			A[i] = A[large];
			A[large] = temp;
			maxHeapify(A, large);
		}
	}
	
	public static void buildMaxHeap(int[] A){
		for(int i = A.length / 2; i >= 0; i--){
			maxHeapify(A, i);
		}
	}
}

Compiler output:
Main.java:32: error: illegal start of expression
		if(large != i){???//i??????????????????????????????
		               ^
Main.java:32: error: illegal start of expression
		if(large != i){???//i??????????????????????????????
		                ^
Main.java:32: error: illegal start of expression
		if(large != i){???//i??????????????????????????????
		                 ^
Main.java:33: error: '.class' expected
			int temp = A[i];
			    ^
Main.java:33: error: : expected
			int temp = A[i];
			               ^
5 errors
Language: Java

//API???????????????
import java.util.Scanner;
import java.io.IOException;
class Main {
  	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int H = scan.nextInt();
		int[] A = new int[H];
		
		for(int i = 0; i < H; i++){
			A[i] = scan.nextInt();
		}
		buildMaxHeap(A);
		for(int i= 0; i < H; i++){
			if(i != H - 1){
				System.out.print(" " + A[i]);
			}else{
				System.out.println(" " + A[i]);
			}
		}
		System.out.println();
	}
	
	public static void maxHeapify(int[] A, int i){
		int l = (i + 1) * 2 - 1;
		int r = (i + 1) * 2; 
		
		//????????????????????????????????§???????????§????????????????????¶
		int large = i;
		if(l < A.length && A[l] > A[i]) large = l;
		if(r < A.length && A[r] > A[large]) large = r;
		//i?????????????????§????????´???
		if(large != i){???
			int temp = A[i];
			A[i] = A[large];
			A[large] = temp;
			maxHeapify(A, large);
		}
	}
	
	public static void buildMaxHeap(int[] A){
		for(int i = A.length / 2; i >= 0; i--){
			maxHeapify(A, i);
		}
	}
}

Compiler output:
Main.java:33: error: illegal start of expression
		if(large != i){???
		               ^
Main.java:33: error: illegal start of expression
		if(large != i){???
		                ^
Main.java:33: error: illegal start of expression
		if(large != i){???
		                 ^
Main.java:34: error: '.class' expected
			int temp = A[i];
			    ^
Main.java:34: error: : expected
			int temp = A[i];
			               ^
5 errors
Language: C

#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <climits>
#include <cstring>
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))

using namespace std;

const int N_MAX = 2000000001;
int a[N_MAX];

void maxheapfy(int ix, int n){
  int root_key = a[ix];
  int l_key = -N_MAX;
  int r_key = -N_MAX;
  if(2*ix+1 < n) l_key = a[2*ix+1];
  if(2*ix+2 < n) r_key = a[2*ix+2];
  // r max
  if(root_key < r_key && l_key < r_key){
    // swap r and root
    swap(a[2*ix+2], a[ix]);
    maxheapfy(2*ix+2, n);
  }
  else if(root_key < l_key && r_key < l_key){
    // swap l and root
    swap(a[2*ix+1], a[ix]);
    maxheapfy(2*ix+1, n);
  }
}

int main(){
  int n;
  cin >> n;
  rep(i, 0, n) cin >> a[i];
  
  //rep(i, 0, n) cout << a[i] << " ";
  //cout << endl;

  rep(ix, n/2, 0) maxheapfy(ix, n);
  
  rep(i, 0, n) cout << " " << a[i];
  cout << endl;
  return 0;
}



Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C

#include<iostream>
using namespace std;
#define MAX 2000000

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 main(){
  int i;
  
  cin >> H;

  for(i = 1 ; i <= H ; i++){
    cin >> A[i];
  }
  for(i = H / 2 ; i >= 1 ; i--){
    maxHeapify(i);
  }
  for(i = 1 ; i <= H ; i++){
    cout << " " << A[i];;
  }
  cout << endl;

  return 0;
}


Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C

#include <stdio.h>

int Array[500000];
int H;

void maxHeapify(int i){
    int left = 2*(i+1)-1;
    int right = 2*(i+1);
    int largest;
    // select the node which has the maximum value
    if ( left <= H && Array[left] > Array[i])
        largest = left;
    else 
        largest = i;
    if ( right <= H && Array[right] > Array[largest])
        largest = right;

    if (largest != i)　// value of children is larger than that of i
    {
        int temp = Array[i];
        Array[i] = Array[largest];
        A[largest] = temp;
        maxHeapify(largest); // call recursively
    }
}

//void buildMaxHeap(A)
//2    for i = H/2 downto 1
//3        maxHeapify(A, i)

int main(){
    scanf("%d\n",&H);
    for ( int ix = 0 ; ix < H ; ix++){
        if ( ix == H-1) scanf("%d\n",&Array[ix]);
        else scanf("%d ",&Array[ix]);
        
    for ( int ix = H/2 ; ix > 0 ; ix--)
        maxHeapify(ix);
    
    return 0;
}


Compiler output:
main.c: In function 'maxHeapify':
main.c:18:22: error: stray '\343' in program
   18 |     if (largest != i)<U+3000>// value of children is larger than that of i
      |                      ^~~~~~~~
main.c:22:9: error: 'A' undeclared (first use in this function)
   22 |         A[largest] = temp;
      |         ^
main.c:22:9: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'main':
main.c:41:1: error: expected declaration or statement at end of input
   41 | }
      | ^
Language: C

#include <stdio.h>

int Array[500000];
int H;

void maxHeapify(int i){
    int left = 2*(i+1)-1;
    int right = 2*(i+1);
    int largest;
    // select the node which has the maximum value
    if ( left <= H && Array[left] > Array[i])
        largest = left;
    else 
        largest = i;
    if ( right <= H && Array[right] > Array[largest])
        largest = right;

    if (largest != i)　// value of children is larger than that of i
    {
        int temp = Array[i];
        Array[i] = Array[largest];
        Array[largest] = temp;
        maxHeapify(largest); // call recursively
    }
}

//void buildMaxHeap(A)
//2    for i = H/2 downto 1
//3        maxHeapify(A, i)

int main(){
    scanf("%d\n",&H);
    for ( int ix = 0 ; ix < H ; ix++){
        if ( ix == H-1) scanf("%d\n",&Array[ix]);
        else scanf("%d ",&Array[ix]);
        
    for ( int ix = H/2 ; ix > 0 ; ix--)
        maxHeapify(ix);
    
    return 0;
}


Compiler output:
main.c: In function 'maxHeapify':
main.c:18:22: error: stray '\343' in program
   18 |     if (largest != i)<U+3000>// value of children is larger than that of i
      |                      ^~~~~~~~
main.c: In function 'main':
main.c:41:1: error: expected declaration or statement at end of input
   41 | }
      | ^