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

#include<cstdio>
#include<cstdlib>
#include<string>
#include<iostream>
using namespace std;

struct Node{
  int key,priority;
  Node *right,*left;
};

Node *root, *NIL;

Node * find(Node *u,int k){
  while(u!=NIL && k!=u->key){
    if(k<u->key) u = u->left;
    else u=u->right;
  }
  return u;
}

void inorder(Node *u){
  if(u==NIL) return;
  inorder(u->left);
  printf(" %d",u->key);
  inorder(u->right);
}

void preorder(Node *u){
  if(u==NIL) return;
  printf(" %d",u->key);
  preorder(u->left);
  preorder(u->right);
}

Node *rightRotate(Node *u){
  Node *k=u->left;
  u->left=k->right;
  k->right=u;
  return k;
}

Node *leftRotate(Node *u){
  Node *k=u->right;
  u->right=k->left;
  k->left=u;
  return k;
}

Node* insert(Node *t,int key,int priority){
  Node *new;
	
  if(t==NIL)
    return new(key,priority);
  if (t->key==key)
    return t;
	
  if(key < t->key){
    t->left=insert(t->left,key,priority);
    if(t->priority < t->left->priority)
      t=rightRotate(t);
  }
  else {
    t->right=insert(t->right,key,priority);
    if(t->priority < t->right->priority)
      t=leftRotate(t);
  }
	
  return t;
}


Node * Delete(Node *t,int key){
  if(t==NIL)
    return NIL;
		
  if(key < t->key)
    t->left=Delete(t->left,key);
		
  else if(key > t->key)
    t->right=Delete(t->right,key);
		
  else return _delete(t,key);
	
  return t;
}

Node * _delete(Node *t,int key){
  if(t->left==NIL && t->right==NIL)
    return NIL;
  else if(t->left==NIL)
    t=leftRotate(t);
  else if(t->right==NIL)
    t=rightRotate(t);
  else {
    if(t->left->priority > t->right->priority)
      t=rightRotate(t);
    else
      t=leftRotate(t);
  }
  return Delete(t,key);
}

int main(){
  int n,i,x;
  string com;

  scanf("%d",&n);

  for(i = 0;i < n; i++){
    cin >> com;

    if(com[0] == 'f'){
      scanf("%d",&x);
      Node *t = find(root,x);
      if(t!=NIL) printf("yes\n");
      else printf("no\n");
    }else if(com == "insert"){
      scanf("%d",&x);
      insert(x);
    }else if(com == "print"){
      inorder(root);
      printf("\n");
      preorder(root);
      printf("\n");
    }else if(com == "delete"){
      scanf("%d",&x);
      Delete(root,x);
    }
  }

  return 0;
}



Compiler output:
a.cc: In function 'Node* insert(Node*, int, int)':
a.cc:51:9: error: expected unqualified-id before 'new'
   51 |   Node *new;
      |         ^~~
a.cc:54:29: error: expected type-specifier before ';' token
   54 |     return new(key,priority);
      |                             ^
a.cc: In function 'Node* Delete(Node*, int)':
a.cc:83:15: error: '_delete' was not declared in this scope; did you mean 'Delete'?
   83 |   else return _delete(t,key);
      |               ^~~~~~~
      |               Delete
a.cc: In function 'int main()':
a.cc:120:14: error: invalid conversion from 'int' to 'Node*' [-fpermissive]
  120 |       insert(x);
      |              ^
      |              |
      |              int
a.cc:120:13: error: too few arguments to function 'Node* insert(Node*, int, int)'
  120 |       insert(x);
      |       ~~~~~~^~~
a.cc:50:7: note: declared here
   50 | Node* insert(Node *t,int key,int priority){
      |       ^~~~~~
Language: Java

import java.util.Scanner;
public class MAIN {
	static int[]heap;
    static int MAXHEAP=100;
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		int i,n;
		heap=new int[MAXHEAP+1];
       Scanner sca= new Scanner(System.in);
       n=sca.nextInt();
       for(i=1;i<=n;i++){
    	   heap[i]=sca.nextInt();
    	   heap[i*2]=heap[i*2+1]=-1;
       }
       for(i=1;i<=n;i++){
    	   System.out.print("node "+i+": key = "+heap[i]+", ");
    	   if(i/2>0)System.out.print("parent key = "+heap[i/2]+", ");
    	   if(i*2<=n){
    		   System.out.print("left key = "+heap[i*2]+", ");
    	   }
       	   if(i*2+1<=n){
    		   System.out.print("right key = "+heap[i*2+1]+", ");
    	   }   
       	 System.out.println("");  
       }
	}

}


Compiler output:
Main.java:2: error: class MAIN is public, should be declared in a file named MAIN.java
public class MAIN {
       ^
1 error
Language: Java

#include <stdio.h>
#include <stdlib.h>
#define MAX 100000
 
typedef struct node * Node;
#define NIL NULL

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


Compiler output:
Main.java:1: error: illegal character: '#'
#include <stdio.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <stdio.h>
         ^
Main.java:2: error: illegal character: '#'
#include <stdlib.h>
^
Main.java:3: error: illegal character: '#'
#define MAX 100000
^
Main.java:6: error: illegal character: '#'
#define NIL NULL
^
Main.java:6: error: class, interface, enum, or record expected
#define NIL NULL
        ^
Main.java:10: error: class, interface, enum, or record expected
	int A[MAX+1];
	^
Main.java:11: error: class, interface, enum, or record expected
	scanf("%d",&n);
	^
Main.java:12: error: class, interface, enum, or record expected
	for(i=1; i<n+1; i++){
	^
Main.java:12: error: class, interface, enum, or record expected
	for(i=1; i<n+1; i++){
	         ^
Main.java:12: error: class, interface, enum, or record expected
	for(i=1; i<n+1; i++){
	                ^
Main.java:14: error: class, interface, enum, or record expected
	}
	^
Main.java:15: error: class, interface, enum, or record expected
	for(i=1;i<n+1;i++){
	        ^
Main.java:15: error: class, interface, enum, or record expected
	for(i=1;i<n+1;i++){
	              ^
Main.java:17: error: class, interface, enum, or record expected
		if(i>1)printf("parent key = %d,",A[i/2]);
		^
Main.java:18: error: class, interface, enum, or record expected
		if(i*2<n+1)printf("left key = %d , ",A[i*2]);
		^
Main.java:19: error: class, interface, enum, or record expected
		if(i*2+1<n+1)printf("right key = %d,",A[i*2+1]);
		^
Main.java:20: error: class, interface, enum, or record expected
		printf("\n");
		^
Main.java:21: error: class, interface, enum, or record expected
	}
	^
19 errors
Language: Java

#include <stdio.h>
#include <stdlib.h>
#define MAX 100000
 
typedef struct node * Node;
#define NIL NULL

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


Compiler output:
Main.java:1: error: illegal character: '#'
#include <stdio.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <stdio.h>
         ^
Main.java:2: error: illegal character: '#'
#include <stdlib.h>
^
Main.java:3: error: illegal character: '#'
#define MAX 100000
^
Main.java:6: error: illegal character: '#'
#define NIL NULL
^
Main.java:6: error: class, interface, enum, or record expected
#define NIL NULL
        ^
Main.java:10: error: class, interface, enum, or record expected
	int A[MAX+1];
	^
Main.java:11: error: class, interface, enum, or record expected
	scanf("%d",&n);
	^
Main.java:12: error: class, interface, enum, or record expected
	for(i=1; i<n+1; i++){
	^
Main.java:12: error: class, interface, enum, or record expected
	for(i=1; i<n+1; i++){
	         ^
Main.java:12: error: class, interface, enum, or record expected
	for(i=1; i<n+1; i++){
	                ^
Main.java:14: error: class, interface, enum, or record expected
	}
	^
Main.java:15: error: class, interface, enum, or record expected
	for(i=1;i<n+1;i++){
	        ^
Main.java:15: error: class, interface, enum, or record expected
	for(i=1;i<n+1;i++){
	              ^
Main.java:17: error: class, interface, enum, or record expected
		if(i>1)printf("parent key = %d,",A[i/2]);
		^
Main.java:18: error: class, interface, enum, or record expected
		if(i*2<n+1)printf("left key = %d , ",A[i*2]);
		^
Main.java:19: error: class, interface, enum, or record expected
		if(i*2+1<n+1)printf("right key = %d,",A[i*2+1]);
		^
Main.java:20: error: class, interface, enum, or record expected
		printf("\n");
		^
Main.java:21: error: class, interface, enum, or record expected
	}
	^
19 errors
Language: Java

import java.util.*;

public class Main{
  Scanner sc = new Scanner(System.in);
  StringBuilder sb = new StringBuilder();

  int H;
  int[] A;

  public static void main(String[] args){
    A main = new A();
    main.in();
    main.out();
  }
  public void in(){
    H = sc.nextInt();
    A = new int[H + 1];
    for(int i = 1;i < A.length;i++){
      A[i] = sc.nextInt();
    }
  }
  public void out(){
    int id;
    for(int i = 1;i < A.length;i++){
      sb.append("node ").append(Integer.toString(i));
      sb.append(": key = ").append(Integer.toString(A[i])).append(", ");

      id = i / 2;
      if(!(id < 1)){
        sb.append("parent key = ").append( Integer.toString(A[id]) ).append(" ");
       
      }
      id = 2 * i;
      if(!(id > H)){
        sb.append("left key = ").append( Integer.toString(A[id])).append(", ");
      }
      id = 2 * i + 1;
      if(!(id > H)){
        sb.append("right key = ").append( Integer.toString(A[id])).append(", ");
      }
      sb.append("\n");
    }
System.out.print(sb.toString());
  }

}


Compiler output:
Main.java:11: error: cannot find symbol
    A main = new A();
    ^
  symbol:   class A
  location: class Main
Main.java:11: error: cannot find symbol
    A main = new A();
                 ^
  symbol:   class A
  location: class Main
2 errors
Language: Java

import java.util.*;

public class A{
  Scanner sc = new Scanner(System.in);
  StringBuilder sb = new StringBuilder();

  int H;
  int[] A;

  public static void main(String[] args){
    A main = new A();
    main.in();
    main.out();
  }
  public void in(){
    H = sc.nextInt();
    A = new int[H + 1];
    for(int i = 1;i < A.length;i++){
      A[i] = sc.nextInt();
    }
  }
  public void out(){
    int id;
    for(int i = 1;i < A.length;i++){
      sb.append("node ").append(Integer.toString(i));
      sb.append(": key = ").append(Integer.toString(A[i])).append(", ");

      id = i / 2;
      if(!(id < 1)){
        sb.append("parent key = ").append( Integer.toString(A[id]) ).append(" ");
       
      }
      id = 2 * i;
      if(!(id > H)){
        sb.append("left key = ").append( Integer.toString(A[id])).append(", ");
      }
      id = 2 * i + 1;
      if(!(id > H)){
        sb.append("right key = ").append( Integer.toString(A[id])).append(", ");
      }
      sb.append("\n");
    }
System.out.print(sb.toString());
  }

}


Compiler output:
Main.java:3: error: class A is public, should be declared in a file named A.java
public class A{
       ^
1 error
Language: Java

import java.util.*;

public class Main{
  Scanner sc = new Scanner(System.in);
  StringBuilder sb = new StringBuilder();

  int H;
  int[] A;

  public static void main(String[] args){
    Main main = new A();
    main.in();
    main.out();
  }
  public void in(){
    H = sc.nextInt();
    A = new int[H + 1];
    for(int i = 1;i < A.length;i++){
      A[i] = sc.nextInt();
    }
  }
  public void out(){
    int id;
    for(int i = 1;i < A.length;i++){
      sb.append("node ").append(Integer.toString(i));
      sb.append(": key = ").append(Integer.toString(A[i])).append(", ");

      id = i / 2;
      if(!(id < 1)){
        sb.append("parent key = ").append( Integer.toString(A[id]) ).append(" ");
       
      }
      id = 2 * i;
      if(!(id > H)){
        sb.append("left key = ").append( Integer.toString(A[id])).append(", ");
      }
      id = 2 * i + 1;
      if(!(id > H)){
        sb.append("right key = ").append( Integer.toString(A[id])).append(", ");
      }
      sb.append("\n");
    }
System.out.print(sb.toString());
  }

}


Compiler output:
Main.java:11: error: cannot find symbol
    Main main = new A();
                    ^
  symbol:   class A
  location: class Main
1 error
Language: Java

import java.util.*;

public class Main{
  Scanner sc = new Scanner(System.in);
  StringBuilder sb = new StringBuilder();

  int H;
  int[] A;

  public static void main(String[] args){
    A main = new Main();
    main.in();
    main.out();
  }
  public void in(){
    H = sc.nextInt();
    A = new int[H + 1];
    for(int i = 1;i < A.length;i++){
      A[i] = sc.nextInt();
    }
  }
  public void out(){
    int id;
    for(int i = 1;i < A.length;i++){
      sb.append("node ").append(Integer.toString(i));
      sb.append(": key = ").append(Integer.toString(A[i])).append(", ");

      id = i / 2;
      if(!(id < 1)){
        sb.append("parent key = ").append( Integer.toString(A[id]) ).append(" ");
       
      }
      id = 2 * i;
      if(!(id > H)){
        sb.append("left key = ").append( Integer.toString(A[id])).append(", ");
      }
      id = 2 * i + 1;
      if(!(id > H)){
        sb.append("right key = ").append( Integer.toString(A[id])).append(", ");
      }
      sb.append("\n");
    }
System.out.print(sb.toString());
  }

}


Compiler output:
Main.java:11: error: cannot find symbol
    A main = new Main();
    ^
  symbol:   class A
  location: class Main
1 error
Language: Java

public class Solution {
    /**
     * @param root, the root of binary tree.
     * @return true if it is a complete binary tree, or false.
     */
    public boolean isComplete(TreeNode root) {
    	if (root == null) {
    		return true;
    	}

    	Queue<TreeNode> queue = new LinkedList<TreeNode>();
    	queue.offer(root);
        boolean flag = false;
    	while (!queue.isEmpty()) {
    		TreeNode node = queue.poll();
    		if (flag && (node.left != null || node.right != null)) {
    		    return false;
    		}
    		if (node.left == null && node.right != null) {
    			return false;
    		} else if (node.left == null || node.right == null) {
    		    flag = true;
    		} 
    		if (node.left != null) {
        		queue.offer(node.left);    		    
    		}
            if (node.right != null) {
                queue.offer(node.right);    
            }
    	}

    	return true;
    }

}


Compiler output:
Main.java:1: error: class Solution is public, should be declared in a file named Solution.java
public class Solution {
       ^
Main.java:6: error: cannot find symbol
    public boolean isComplete(TreeNode root) {
                              ^
  symbol:   class TreeNode
  location: class Solution
Main.java:11: error: cannot find symbol
    	Queue<TreeNode> queue = new LinkedList<TreeNode>();
    	^
  symbol:   class Queue
  location: class Solution
Main.java:11: error: cannot find symbol
    	Queue<TreeNode> queue = new LinkedList<TreeNode>();
    	      ^
  symbol:   class TreeNode
  location: class Solution
Main.java:11: error: cannot find symbol
    	Queue<TreeNode> queue = new LinkedList<TreeNode>();
    	                            ^
  symbol:   class LinkedList
  location: class Solution
Main.java:11: error: cannot find symbol
    	Queue<TreeNode> queue = new LinkedList<TreeNode>();
    	                                       ^
  symbol:   class TreeNode
  location: class Solution
Main.java:15: error: cannot find symbol
    		TreeNode node = queue.poll();
    		^
  symbol:   class TreeNode
  location: class Solution
7 errors
Language: Java

import java.io.*;
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));
int num=Integer.parseInt(br.readLine());
int[] heap=new int[num+1];
int parent,left,right;
StringBuilder sb;
StringTokenizer st=new StringTokenizer(br.readLine());
for(int i=0;i<num;i++){
heap[i+1]=Integer.parseInt(st.nextToken());
}
for(int i=1;i<=num;i++){
sb=new StringBuilder();
sb.append("node ");
sb.append(i);
sb.append(": key = ");
sb.append(heap[i]);
parent=i/2;
left=i*2;
right=i*2+1;
if(parent>=1&&parent<=num){
sb.append(", parent key = ");
sb.append(heap[parent]);
}
if(left>=1&&left<=num){
sb.append(", left key = ");
sb.append(heap[left]);
if(right>=1&&right<=num){
sb.append(", right key = ");
sb.append(heap[right]);
}
sb.append(", ");
out.println(sb);
}
out.flush();
}
}

Compiler output:
Main.java:43: error: reached end of file while parsing
}
 ^
1 error
Language: Java

import com.sun.javaws.exceptions.InvalidArgumentException;

import java.util.Scanner;

public class Main {
    static Scanner sc = new Scanner(System.in);
    static int n;
    static int[] H = new int[300];
    public static final int NULL = 2 << 31 - 1;

    public static void main(String[] args) {
        read();
        solve();
    }

    public static void read() {
        n = sc.nextInt();
        for (int i = 0; i < n; i++) {
            H[i + 1] = sc.nextInt();
        }
    }

    public static void solve() {
        for (int i = 1; i <= n; i++) {
            int key, leftKey, rightKey, parentKey;
            key = getKey(i);
            leftKey = getLeftKey(i);
            rightKey = getRightKey(i);
            parentKey = getParentKey(i);

            String s;
            s = String.format("node %d: key = %d, ", i, key);
            if (parentKey != NULL) {
                s += String.format("parent key = %d, ", parentKey);
            }
            if (leftKey != NULL) {
                s += String.format("left key = %d, ", leftKey);
            }
            if (rightKey != NULL) {
                s += String.format("right key = %d, ", rightKey);
            }
            System.out.println(s);
        }
    }

    public static int getKey(int ix) {
        if (ix > n) {
            return NULL;
        }
        return H[ix];
    }

    public static int getLeftKey(int ix) {
        int leftIx = ix * 2;
        return getKey(leftIx);
    }

    public static int getRightKey(int ix) {
        int rightIx = ix * 2 + 1;
        return getKey(rightIx);
    }

    public static int getParentKey(int ix) throws InvalidArgumentException {
        if (ix == 1) {
            return NULL;
        }

        int parentIx = ix / 2;
        return getKey(parentIx);
    }
}

Compiler output:
Main.java:1: error: package com.sun.javaws.exceptions does not exist
import com.sun.javaws.exceptions.InvalidArgumentException;
                                ^
Main.java:63: error: cannot find symbol
    public static int getParentKey(int ix) throws InvalidArgumentException {
                                                  ^
  symbol:   class InvalidArgumentException
  location: class Main
2 errors
Language: Java

import java.util.*;

public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int h = scan.nextInt();

		int[] a = new int[h+1];
		
		for(int i = 1; i <= h; i++)
			a[i] = scan.nextInt();

		for(int i = 1; i<= h; i++)
			print(a, i);

		scan.close();
		System.exit(0);
	}

	private static void print(int[] a, int i){
		System.out.print("node " + i + ": ");
		System.out.print("key = " + a[i] + ", ");
		if(i > 1)
			System.out.print("parent key = " + a[i/2] + ", ");
		if(i * 2 < a.length)
			System.out.print("left key = " + a[i*2] + ", ");
		if(i * 2 + 1 < a/length)
			System.out.print("right key = " + a[i*2+1] + ", ");
		System.out.print("\n");
	}
}

Compiler output:
Main.java:27: error: cannot find symbol
		if(i * 2 + 1 < a/length)
		                 ^
  symbol:   variable length
  location: class Main
1 error
Language: Java

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.Arrays;
import java.util.Scanner;

class Main {
    static Node root = null;
    static StringBuilder sb = new StringBuilder("");

    public static void main (String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        int h = sc.nextInt();
        int[] a = new int[h];
        for (int i = 0; i < h; i++) {
            a[i] = sc.nextInt();
        }

        StringBuilder sb = new StringBuilder("");
        int parent, left, right;
        for (int i = 0; i < h; i++) {
            sb.append("node ").append(i + 1);
            sb.append(": key = ").append(a[i]);
            parent = (i + 1) / 2 - 1;
            if (parent >= 0) {
                sb.append(", parent key = ").append(a[parent]);
            }
            left = i * 2 + 1;
            if (left < h) {
                sb.append(", left key = ").append(a[left]);
            }
            right = left + 1;
            if (right < h) {
                sb.append(", right key = ").append(a[right]);
            }
            sb.append(", \n");
        }
        System.out.print(sb);

    }
}

Compiler output:
Main.java:8: error: cannot find symbol
    static Node root = null;
           ^
  symbol:   class Node
  location: class Main
1 error
Language: Java

import java.io.File;
import java.io.IOException;
import java.util.ArrayDeque;
import java.util.Queue;
import java.util.Scanner;

public class CompleteBinaryTree {

	static int id;
	public static void main(String[] args) throws IOException {

		Scanner in = new Scanner(System.in);

		int h = in.nextInt();
		Queue<Long> a = new ArrayDeque<Long>();
		for (int i = 0; i < h; i++) {
			a.add(in.nextLong());
		}

		// solve
		Node nFirst = new Node(++id, a.remove(), Long.MAX_VALUE, null, null);
		Queue<Node> q = new ArrayDeque<>();
		q.add(nFirst);

		for (int i = 1; i < h; i++) {
			while (!q.isEmpty()) {
				Node n = q.peek();
				if (n.left != null) {
					q.add(n.left);
				} else {
					if (!a.isEmpty()) {
						Node newLeftNode = new Node(++id, a.remove(), n.nodeNum, null, null);
						n.left = newLeftNode;
						q.add(newLeftNode);
					}
				}

				if (n.right != null) {
					q.add(n.right);
				} else {
					if (!a.isEmpty()) {
						Node newRightNode = new Node(++id, a.remove(), n.nodeNum, null, null);
						n.right = newRightNode;
						q.add(newRightNode);
					}
					q.remove();
				}
			}
		}

		q.clear();
		q.add(nFirst);

		StringBuffer sb = new StringBuffer();
		for (int i = 1; i < h; i++) {
			while (!q.isEmpty()) {
				Node n = q.remove();
				sb.append("node "+n.id+": key = "+n.nodeNum);
				if (n.parentNodeNum != Long.MAX_VALUE) {
					sb.append(", parent key = "+n.parentNodeNum+", ");
				}
				if (n.left != null) {
					q.add(n.left);
					sb.append("left key = "+n.left.nodeNum);
				}
				if (n.right != null) {
					q.add(n.right);
					sb.append(", right key = "+n.right.nodeNum+",");
				}
				sb.append("\n");
			}
		}

		System.out.print(sb.toString());

	}
	static class Node {
		int id;
		long nodeNum;
		long parentNodeNum;
		Node left;
		Node right;

		public Node(int id, long nodeNum, long parentNodeNum, Node left, Node right) {
			this.id = id;
			this.nodeNum = nodeNum;
			this.parentNodeNum = parentNodeNum;
			this.left = left;
			this.right = right;
		}
	}

}



Compiler output:
Main.java:7: error: class CompleteBinaryTree is public, should be declared in a file named CompleteBinaryTree.java
public class CompleteBinaryTree {
       ^
1 error
Language: C

#include <stdio.h>

int Array[250];

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


Compiler output:
main.c: In function 'main':
main.c:7:11: error: expected expression before '%' token
    7 |     scanf(%d\N);
      |           ^
main.c:7:13: error: stray '\' in program
    7 |     scanf(%d\N);
      |             ^
Language: C

#include <stdio.h>

int Array[250];

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


Compiler output:
main.c: In function 'main':
main.c:7:11: error: expected expression before '%' token
    7 |     scanf(%d\N);
      |           ^
main.c:7:13: error: stray '\' in program
    7 |     scanf(%d\N);
      |             ^
Language: C

#include <stdio.h>

int Array[250];

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


Compiler output:
main.c: In function 'main':
main.c:7:11: error: expected expression before '%' token
    7 |     scanf(%d\N);
      |           ^
main.c:7:13: error: stray '\' in program
    7 |     scanf(%d\N);
      |             ^
Language: C

#include <stdio.h>



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


Compiler output:
main.c: In function 'main':
main.c:7:11: error: expected expression before '%' token
    7 |     scanf(%d\N);
      |           ^
main.c:7:13: error: stray '\' in program
    7 |     scanf(%d\N);
      |             ^
Language: C

#include <stdio.h>



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


Compiler output:
main.c: In function 'main':
main.c:7:11: error: expected expression before '%' token
    7 |     scanf(%d\n,&N);
      |           ^
main.c:7:13: error: stray '\' in program
    7 |     scanf(%d\n,&N);
      |             ^
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 i,h,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;
}


node 1: key = 7, left key = 8, right key = 1,
node 2: key = 8, parent key = 7, left key = 2, right key = 3,
node 3: key = 1, parent key = 7,
node 4: key = 2, parent key = 8,
node 5: key = 3, parent key = 8,



Compiler output:
main.c:38:6: error: expected '=', ',', ';', 'asm' or '__attribute__' before numeric constant
   38 | node 1: key = 7, left key = 8, right key = 1,
      |      ^
Language: C

#include<stdio.h>
#define M 100000

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

int main(){
  int N,i,st[M+1];

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



std4dc3:alg s1250156[75]$ cat E9a.c
#include<stdio.h>
#define M 100000

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

int main(){
  int N,i,st[M+1];

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


Compiler output:
main.c:34:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
   34 | std4dc3:alg s1250156[75]$ cat E9a.c
      |        ^
main.c:41:5: error: redefinition of 'left'
   41 | int left(int j){
      |     ^~~~
main.c:7:5: note: previous definition of 'left' with type 'int(int)'
    7 | int left(int j){
      |     ^~~~
main.c:44:5: error: redefinition of 'right'
   44 | int right(int k){
      |     ^~~~~
main.c:10:5: note: previous definition of 'right' with type 'int(int)'
   10 | int right(int k){
      |     ^~~~~
main.c:48:5: error: redefinition of 'main'
   48 | int main(){
      |     ^~~~
main.c:14:5: note: previous definition of 'main' with type 'int()'
   14 | int main(){
      |     ^~~~
Language: C

#include <stdio.h>

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

return 0;
}


Compiler output:
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
    3 | main(){
      | ^~~~
main.c: In function 'main':
main.c:4:17: error: redeclaration of 's' with no linkage
    4 |   int i,d=0,s=1,s,data[251];
      |                 ^
main.c:4:13: note: previous definition of 's' with type 'int'
    4 |   int i,d=0,s=1,s,data[251];
      |             ^
main.c:16:1: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
   16 | print("\n");
      | ^~~~~
      | printf
Language: C

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

#define H 250

int main(){
  int x,a,b,c,i,A[H+1];

  scanf("%d",&x);

  for(i=1;i<=x;i++){
    scanf("%d",&A[i]);
  }


  for(i=1;i<=x;i++){
    printf("node %d: key = %d, ",i,A[i]);
    if(i==1) {
      if(x==2) printf("left key = %d, ",A[2*i]);
      else printf("left key = %d, right key = %d, ",A[2*i],A[2*i+1]);
    }
    else
      {
	printf("parent key = %d, ",A[i/2]);
	if(x>=2*i) printf("left key = %d, ",A[2*i]);
 	if(x>=2*i+1) printf("right key = %d, ",A[2*i+1]);
	
			    }
    printf("\n");
  }

  return 0;
}



Compiler output:
main.c:2:9: fatal error: stdlib.c: No such file or directory
    2 | #include<stdlib.c>
      |         ^~~~~~~~~~
compilation terminated.
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=0;i<=H;i++){
    scanf("%d",A[i]);
  }

  for(i=1;i<=H;i++){
    pritnf("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:24:5: error: implicit declaration of function 'pritnf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   24 |     pritnf("node %d: key = %d, ",i,A[i]);
      |     ^~~~~~
      |     printf
Language: C

import java.io.*;
import java.util.*;

class Main{
 public static int[] A;
    public static void main(String[] args){
        int i;
        int n=0;
        String s;
        //int[] A;
        try{
            BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
            s = bf.readLine();
            n = Integer.parseInt(s);
            A = new int[n+1];
            StringTokenizer S = new StringTokenizer(bf.readLine());

            for(i=1 ; i<=n ; i++){
                A[i] = Integer.parseInt(S.nextToken());
            }
            bf.close();
        }
        catch(IOException e){
        System.out.println(e);
        }

        for(i=1 ; i<=n ; i++){
            System.out.print("node "+i+": key = "+A[i]+", ");
            if( (i/2) != 0 ){
                System.out.print("parent key = "+A[(i/2)]+", ");
            }
            if( (2*i) <= n ){
                System.out.print("left key = "+A[(2*i)]+", ");
            }
            if( (2*i+1) <= n ){
                System.out.print("right key = "+A[(2*i+1)]+", ");
            }
            System.out.print("\n");
        }
    }
}



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

include <stdio.h>

int main(){
 int i,H,N[251];

  scanf("%d",&H);

  for(i = 1; i <= H; i++){
    scanf("%d",&N[i]);
  }

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


Compiler output:
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include <stdio.h>
      |         ^
Language: C

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

struct node{
  int key;
  struct node *parent;
  struct node *right;
  struct node *left;
};
typedef struct node *Node;
Node T;
#define NIL NULL;

void Insert(int);
void Preorder(Node);
void Inoder(Node);

int main(){

  int n,i,key;
  char S[7];

  scanf("%d",&n);

  for(i=0;i<n;i++){
    scanf("%s",S);
    if(S[0]=='i'){
      scanf("%d",&key);
      Insert(key);
    }
    else{
      Inoder(T);
      printf("\n");
      Preorder(T);
      printf("\n");
    }
  }
  return 0;
}
void Insert(int key){
  Node x,y,z;
  y=NIL;
  x=T;
  z=malloc(sizeof(struct node));
  z->key=key;
  z->left=NIL;
  z->right=NIL;
  while(x!=NULL){
    y=x;
    if(z->key < x->key ){
      x=x->left;}
      else{
        x=x->right;
      }
    }
      z->parent=y;
      if(y==NULL){
        T=z;
      }
      else if(z->key<y->key){
        y->left=z;
      }
      else{
        y->right=z;
      }
    }
    void Inorder(Node T){
      if(T->left!=NULL && T->right!=NULL){
        Inorder(T->left);
        printf(" %d",T->key);
        Inorder(T->right);
      }
      if(T->left!=NULL && T->right==NULL){
        Inorder(T->left);
        printf(" %d",T->key);
      }
      if(T->left==NULL && T->right!=NULL){
        printf(" %d",T->key);
        Inorder(T->right);
      }
      if(T->left==NULL && T->right==NULL){

        printf(" %d",T->key);

      }





    }



Compiler output:
/usr/bin/ld: /tmp/ccDmRMjE.o: in function `main':
main.c:(.text+0x84): undefined reference to `Inoder'
/usr/bin/ld: main.c:(.text+0x9d): undefined reference to `Preorder'
collect2: error: ld returned 1 exit status
Language: C

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

struct node{
  int key;
  struct node *parent;
  struct node *right;
  struct node *left;
};
typedef struct node *Node;
Node T;
#define NIL NULL;

void Insert(int);
void Preorder(Node);
void Inoder(Node);

int main(){

  int n,i,key;
  char S[7];

  scanf("%d",&n);

  for(i=0;i<n;i++){
    scanf("%s",S);
    if(S[0]=='i'){
      scanf("%d",&key);
      Insert(key);
    }
    else{
      Inoder(T);
      printf("\n");
      Preorder(T);
      printf("\n");
    }
  }
  return 0;
}
void Insert(int key){
  Node x,y,z;
  y=NIL;
  x=T;
  z=malloc(sizeof(struct node));
  z->key=key;
  z->left=NIL;
  z->right=NIL;
  while(x!=NULL){
    y=x;
    if(z->key < x->key ){
      x=x->left;}
      else{
        x=x->right;
      }
    }
      z->parent=y;
      if(y==NULL){
        T=z;
      }
      else if(z->key<y->key){
        y->left=z;
      }
      else{
        y->right=z;
      }
    }
    void Inorder(Node T){
      if(T->left!=NULL && T->right!=NULL){
        Inorder(T->left);
        printf(" %d",T->key);
        Inorder(T->right);
      }
      if(T->left!=NULL && T->right==NULL){
        Inorder(T->left);
        printf(" %d",T->key);
      }
      if(T->left==NULL && T->right!=NULL){
        printf(" %d",T->key);
        Inorder(T->right);
      }
      if(T->left==NULL && T->right==NULL){

        printf(" %d",T->key);

      }





    }



Compiler output:
/usr/bin/ld: /tmp/ccHGrejo.o: in function `main':
main.c:(.text+0x84): undefined reference to `Inoder'
/usr/bin/ld: main.c:(.text+0x9d): undefined reference to `Preorder'
collect2: error: ld returned 1 exit status
Language: C

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

struct node{
  int key;
  struct node *parent;
  struct node *right;
  struct node *left;
};
typedef struct node *Node;
Node T;
#define NIL NULL;

void Insert(int);
void Preorder(Node);
void Inoder(Node);

int main(){

  int n,i,key;
  char S[7];

  scanf("%d",&n);

  for(i=0;i<n;i++){
    scanf("%s",S);
    if(S[0]=='i'){
      scanf("%d",&key);
      Insert(key);
    }
    else{
      Inoder(T);
      printf("\n");
      Preorder(T);
      printf("\n");
    }
  }
  return 0;
}
void Insert(int key){
  Node x,y,z;
  y=NIL;
  x=T;
  z=malloc(sizeof(struct node));
  z->key=key;
  z->left=NIL;
  z->right=NIL;
  while(x!=NULL){
    y=x;
    if(z->key < x->key ){
      x=x->left;}
      else{
        x=x->right;
      }
    }
      z->parent=y;
      if(y==NULL){
        T=z;
      }
      else if(z->key<y->key){
        y->left=z;
      }
      else{
        y->right=z;
      }
    }
    void Inorder(Node T){
      if(T->left!=NULL && T->right!=NULL){
        Inorder(T->left);
        printf(" %d",T->key);
        Inorder(T->right);
      }
      if(T->left!=NULL && T->right==NULL){
        Inorder(T->left);
        printf(" %d",T->key);
      }
      if(T->left==NULL && T->right!=NULL){
        printf(" %d",T->key);
        Inorder(T->right);
      }
      if(T->left==NULL && T->right==NULL){

        printf(" %d",T->key);

      }





    }



Compiler output:
/usr/bin/ld: /tmp/ccjgyX9i.o: in function `main':
main.c:(.text+0x84): undefined reference to `Inoder'
/usr/bin/ld: main.c:(.text+0x9d): undefined reference to `Preorder'
collect2: error: ld returned 1 exit status
Language: C



include <stdio.h>
#define MAX 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 (){
  int i,n,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)<=1)
      printf("left key = %d, ",A[left(i)]);
    if(right(i)<=n)
      printf("right key = %d, ",A[right(i)]);
  printf("\n");
  }
  return 0;
}



Compiler output:
main.c:3:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    3 | include <stdio.h>
      |         ^
main.c: In function 'main':
main.c:20:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   20 |   scanf("%d",&n);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | 
main.c:20:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   20 |   scanf("%d",&n);
      |   ^~~~~
main.c:20:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:25:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   25 |     printf("node %d : key = %d, ",i,A[i]);
      |     ^~~~~~
main.c:25:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:25:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:25:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:26:8: error: implicit declaration of function 'parent' [-Wimplicit-function-declaration]
   26 |     if(parent(i)>=1)
      |        ^~~~~~
Language: C

#include<stdio.h>
#define max 100000
int parent(int i){
return i/2;
}
int leftnode(int i){return 2*i;}
int rightnode(int i){return 2*i+1;}

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



Compiler output:
main.c: In function 'main':
main.c:16:31: error: expected ')' before 'i'
   16 |   printf("node %d: key = %d, "i,H[i]);
      |         ~                     ^
      |                               )
main.c:17:45: error: expected ')' before 'H'
   17 |   if(parent(i)>=1)printf("parent key = %d, "H[parent(i)]);
      |                         ~                   ^
      |                                             )
main.c:18:45: error: expected ')' before 'H'
   18 |   if(leftnode(i)<=n)printf("left key = %d, "H[leftnode(i)]);
      |                           ~                 ^
      |                                             )
main.c:19:47: error: expected ')' before 'H'
   19 |   if(rightnode(i)>=1)printf("right key = %d, "H[rightnode(i)]);
      |                            ~                  ^
      |                                               )
Language: C

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



Compiler output:
main.c: In function 'main':
main.c:21:8: error: implicit declaration of function 'parent'; did you mean 'parenty'? [-Wimplicit-function-declaration]
   21 |     if(parent(k)>=1)printf("parent key = %d, ",A[parent(k)]);
      |        ^~~~~~
      |        parenty
Language: C

include <stdio.h>
#define MAX 10000
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 A[MAX+1];
  int H,k;
  scanf("%d",&H);
  for(k=1;k<=H;k++){
    scanf("%d",&A[k]);
  }
  for(k=1;k<=H;k++){
    printf("node %d: key = %d, ",k,A[k]);
    if(parent(k)>=1)printf("parent key = %d, ",A[parent(k)]);
    if(parent(k)<=H)printf("left key = %d, ",A[left(k)]);
    if(parent(k)<=H)printf("right key = %d, ",A[right(k)]);
    printf("\n");
           }
      return 0;
  }



Compiler output:
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include <stdio.h>
      |         ^
main.c: In function 'main':
main.c:15:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   15 |   scanf("%d",&H);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | include <stdio.h>
main.c:15:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   15 |   scanf("%d",&H);
      |   ^~~~~
main.c:15:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:20:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   20 |     printf("node %d: key = %d, ",k,A[k]);
      |     ^~~~~~
main.c:20:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:20:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:20:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:21:8: error: implicit declaration of function 'parent' [-Wimplicit-function-declaration]
   21 |     if(parent(k)>=1)printf("parent key = %d, ",A[parent(k)]);
      |        ^~~~~~
Language: C

#include <stdio.h>
#include <stdlib.h>
#define MAX 100000
  
typedef struct node * Node;
#define NIL NULL
 
int main(){
    int i,j,n;
    int A[MAX+1];
    scanf("%d",&n);
    for(i=1; i<n+1; i++){
        scanf("%d",&A[i]);
    }
    for(i=1;i<n+1;i++){
        printf("node %d: key = %d, ",i,A[i]);
        if(i>1)printf("parent key = %d, ",A[i/2]);
        if(i*2<n+1)printf("left key = %d, ",A[i*2]);
        if(i*2+1<n+1)printf("right key = %d, ",A[i*2+1]);
        printf("\n");
    }
}
Compile Error Logs:

Status
Judge: 4/4 	C 	CPU: 00:00 sec 	Memory: 2044 KB 	Length: 433 B 	2018-07-16 11:48
Results for testcases
Case # 	Verdict 	CPU Time 	Memory 	In 	Out 	Case Name
Case #1	: Accepted	00:00	1980	15	263	testcase_00
Case #2	: Accepted	00:00	2044	45	818	testcase_01
Case #3	: Accepted	00:00	2044	87	1562	testcase_02
Case #4	: Accepted	00:00	1980	729	13056	testcase_03
< prev | 		/ 		| next > 	  		
 
Judge Input #  ( | ) 		Judge Output #  ( | )

		




Compiler output:
main.c:23:1: error: unknown type name 'Compile'
   23 | Compile Error Logs:
      | ^~~~~~~
main.c:23:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Logs'
   23 | Compile Error Logs:
      |               ^~~~
main.c:28:6: error: stray '#' in program
   28 | Case #  Verdict         CPU Time        Memory  In      Out     Case Name
      |      ^
main.c:29:6: error: stray '#' in program
   29 | Case #1 : Accepted      00:00   1980    15      263     testcase_00
      |      ^
main.c:30:6: error: stray '#' in program
   30 | Case #2 : Accepted      00:00   2044    45      818     testcase_01
      |      ^
main.c:31:6: error: stray '#' in program
   31 | Case #3 : Accepted      00:00   2044    87      1562    testcase_02
      |      ^
main.c:32:6: error: stray '#' in program
   32 | Case #4 : Accepted      00:00   1980    729     13056   testcase_03
      |      ^
main.c:35:13: error: stray '#' in program
   35 | Judge Input #  ( | )            Judge Output #  ( | )
      |             ^
main.c:35:46: error: stray '#' in program
   35 | Judge Input #  ( | )            Judge Output #  ( | )
      |                                              ^