Language: Java

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

/* Name of the class has to be "Main" only if the class is public. */
class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		// your code goes here
		try {
		    Scanner sc=new Scanner(System.in);
		    long n=sc.nextLong();
		    long k=sc.nextLong();
		    long ar[]=new long[n];
		    long d[]=new long[n];
		    for(long i=0;i<n;i++)
		    {
		        ar[i]=sc.nextLong();
		        d[i]=0;
		    }
		    while(k-->0)
		    {
		        long a=sc.nextLong()-1;
		        long b=sc.nextLong()-1;
		        if(ar[a]>ar[b])
		        {
		         d[a]++;d[b]=-1;   
		        }
		        else if(ar[a]<ar[b])
		        {
		            d[b]++;d[a]=-1;
		        }
		        else if(ar[a]==ar[b])
		        {
		            d[a]=-1;d[b]=-1;
		        }
		    }
		    int c=0;
		    for(long i=0;i<n;i++)
		    {
		        if(d[i]>=0)c++;
		    }
		    System.out.println(c);
		    
		    
		} catch(Exception e) {
		}
	}
}


Compiler output:
Main.java:15: error: incompatible types: possible lossy conversion from long to int
		    long ar[]=new long[n];
		                       ^
Main.java:16: error: incompatible types: possible lossy conversion from long to int
		    long d[]=new long[n];
		                      ^
Main.java:19: error: incompatible types: possible lossy conversion from long to int
		        ar[i]=sc.nextLong();
		           ^
Main.java:20: error: incompatible types: possible lossy conversion from long to int
		        d[i]=0;
		          ^
Main.java:26: error: incompatible types: possible lossy conversion from long to int
		        if(ar[a]>ar[b])
		              ^
Main.java:26: error: incompatible types: possible lossy conversion from long to int
		        if(ar[a]>ar[b])
		                    ^
Main.java:28: error: incompatible types: possible lossy conversion from long to int
		         d[a]++;d[b]=-1;   
		           ^
Main.java:28: error: incompatible types: possible lossy conversion from long to int
		         d[a]++;d[b]=-1;   
		                  ^
Main.java:30: error: incompatible types: possible lossy conversion from long to int
		        else if(ar[a]<ar[b])
		                   ^
Main.java:30: error: incompatible types: possible lossy conversion from long to int
		        else if(ar[a]<ar[b])
		                         ^
Main.java:32: error: incompatible types: possible lossy conversion from long to int
		            d[b]++;d[a]=-1;
		              ^
Main.java:32: error: incompatible types: possible lossy conversion from long to int
		            d[b]++;d[a]=-1;
		                     ^
Main.java:34: error: incompatible types: possible lossy conversion from long to int
		        else if(ar[a]==ar[b])
		                   ^
Main.java:34: error: incompatible types: possible lossy conversion from long to int
		        else if(ar[a]==ar[b])
		                          ^
Main.java:36: error: incompatible types: possible lossy conversion from long to int
		            d[a]=-1;d[b]=-1;
		              ^
Main.java:36: error: incompatible types: possible lossy conversion from long to int
		            d[a]=-1;d[b]=-1;
		                      ^
Main.java:42: error: incompatible types: possible lossy conversion from long to int
		        if(d[i]>=0)c++;
		             ^
17 errors