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

#include<bits/stdc++.h>
using namespace std;
int n,m,ans=0;
vector<int> h,p;
vector<pair<int,int> > a;
int main()
{
	cin>>n>>m;
	for(int i=0;i<n;i++){
		int x;
		cin>>x;
		h.push_back(x);
	}
	for(int i=0;i<m;i++){
		int x,y;cin>>x>>y;
		if(x>y){swap(x,y);}
		a.push_back(make_pair(x,y));
		p.push_back(x);
	}
	sort(p.begin(),p.end());
	sort(a.begin(),a.end());
	sort(h.begin(),h.end());
	int i,j=0;
	for(i=0;i<n;++i){
		while(j<m && h[i]>a[j].first)j++;
		if(h[i]!=a[j].first){ans++;continue;}
		int f=0;
		for(;h[i]==a[j].first;j++){
			if(find(p.begin(),p.end(),a[j].second)!=p.end()){
				f=1;break;
			}
		}
		if(!f)ans++;
	}
	cout<<ans;
	return 0;
}#include<bits/stdc++.h>
using namespace std;
int n,m,ans=0;
vector<int> h,p;
vector<pair<int,int> > a;
int main()
{
	cin>>n>>m;
	for(int i=0;i<n;i++){
		int x;
		cin>>x;
		h.push_back(x);
	}
	for(int i=0;i<m;i++){
		int x,y;cin>>x>>y;
		if(x>y){swap(x,y);}
		a.push_back(make_pair(x,y));
		p.push_back(x);
	}
	sort(p.begin(),p.end());
	sort(a.begin(),a.end());
	sort(h.begin(),h.end());
	int i,j=0;
	for(i=0;i<n;++i){
		while(j<m && h[i]>a[j].first)j++;
		if(h[i]!=a[j].first){ans++;continue;}
		int f=0;
		for(;h[i]==a[j].first;j++){
			if(find(p.begin(),p.end(),a[j].second)!=p.end()){
				f=1;break;
			}
		}
		if(!f)ans++;
	}
	cout<<ans;
	return 0;
}

Compiler output:
a.cc:37:2: error: stray '#' in program
   37 | }#include<bits/stdc++.h>
      |  ^
a.cc:37:3: error: 'include' does not name a type
   37 | }#include<bits/stdc++.h>
      |   ^~~~~~~
a.cc:39:5: error: redefinition of 'int n'
   39 | int n,m,ans=0;
      |     ^
a.cc:3:5: note: 'int n' previously declared here
    3 | int n,m,ans=0;
      |     ^
a.cc:39:7: error: redefinition of 'int m'
   39 | int n,m,ans=0;
      |       ^
a.cc:3:7: note: 'int m' previously declared here
    3 | int n,m,ans=0;
      |       ^
a.cc:39:9: error: redefinition of 'int ans'
   39 | int n,m,ans=0;
      |         ^~~
a.cc:3:9: note: 'int ans' previously defined here
    3 | int n,m,ans=0;
      |         ^~~
a.cc:40:13: error: redefinition of 'std::vector<int> h'
   40 | vector<int> h,p;
      |             ^
a.cc:4:13: note: 'std::vector<int> h' previously declared here
    4 | vector<int> h,p;
      |             ^
a.cc:40:15: error: redefinition of 'std::vector<int> p'
   40 | vector<int> h,p;
      |               ^
a.cc:4:15: note: 'std::vector<int> p' previously declared here
    4 | vector<int> h,p;
      |               ^
a.cc:41:24: error: redefinition of 'std::vector<std::pair<int, int> > a'
   41 | vector<pair<int,int> > a;
      |                        ^
a.cc:5:24: note: 'std::vector<std::pair<int, int> > a' previously declared here
    5 | vector<pair<int,int> > a;
      |                        ^
a.cc:42:5: error: redefinition of 'int main()'
   42 | int main()
      |     ^~~~
a.cc:6:5: note: 'int main()' previously defined here
    6 | int main()
      |     ^~~~
Language: Java

import java.util.*;
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
        int M = sc.nextInt();

        int[] arrH = new int[N];
        for(int i = 0; i < N; i++) {
            arrH[i] = sc.nextInt();
        }

        int tmpA = 0;
        int tmpB = 0;
        boolean[] arrB = new boolean[N];
        for(int j = 0; j < M; j++) {
            tmpA = sc.nextInt() - 1;
            tmpB = sc.nextInt() - 1;
            if(arrH[tmpA] > arrH[tmpB]) {
                arrB[tmpB] = true;
            } else if(arrH[tmpA] < arrH[tmpB]) {
                arrB[tmpA] = true;
            } else {
                arrB[tmpA] = true;
                arrB[tmpB] = true;
            }
        }
        int cnt = 0;
        for(int k = 0; k < N; k++) {
            if(arrS[k] == false) {
                cnt++;
            }
        }
        System.out.println(cnt);
    }
}


Compiler output:
Main.java:30: error: cannot find symbol
            if(arrS[k] == false) {
               ^
  symbol:   variable arrS
  location: class Main
1 error
Language: C++

#include <bits/stdc++.h>

using namespace std;


int main(){
    int n, m;
    cin >> n >> m;
    long long arr[n + 1];
    for(int i = 0; i <= n; i++){
        if(i == 0){
            arr[i] = 0;
            continue;
        }
        cin >> arr[i];
    }
    vector<pair<int, int>> roads;
    for(int i = 0; i < m; i++){
        int a, b;
        cin >> a >> b;
        roads.push_back({a, b});
    }
    vector<int> sol(n + 1, -1);
    sol[0] = 0;
    for(int i = 0; i < m; i++){
        if(arr[roads[i].first] > arr[roads[i].second] && sol[roads[i].first] != 0){
            sol[roads[i].first] = 1;
            sol[roads[i].second] = 0;
        }else{
            if(arr[roads[i].first] == arr[roads[i].second]){
                sol[roads[i].first] = 0;
                sol[roads[i].second] = 0;
            }else{
            sol[roads[i].first] = 0;
            sol[roads[i].second] = 1;
            }
    int res = 0;

    for(int x: sol){
        if(x)
            res++;
    }
    cout << res << '\n';
}

Compiler output:
a.cc: In function 'int main()':
a.cc:44:2: error: expected '}' at end of input
   44 | }
      |  ^
a.cc:25:31: note: to match this '{'
   25 |     for(int i = 0; i < m; i++){
      |                               ^
a.cc:44:2: error: expected '}' at end of input
   44 | }
      |  ^
a.cc:6:11: note: to match this '{'
    6 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define lld long long int
#define M 1000000007
#define fors(i,n) for(int i=0;i<n;++i)
#define fore(i,a,b) for(int i=a;i<=b;++i)
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define vv vector<int>
#define endl "\n"
#define test(i) cout<<i<<endl
#define tests(i) cout<<"i: "<<i<<endl;
#define itrt int t; cin>>t; fors(i,t)
#define itr1 int t; cin>>t;
#define ff first
#define ss second
#define pb push_back
#define vmp make_pair
#define ppb pop_back
#define sorta(a,n) sort(arr,arr+n)
#define sortv(x) sort(x.begin(),x.end())
void file(){
    #ifdef LOCAL
    freopen("demo.in","r",stdin);
    freopen("demo.out","w",stdout);
    #endif
}
bool sortdes(const pair<int,int> &a, const pair<int,int> &b){return a.ss<b.ss;}
bool sortasc(const pair<int,int> &a, const pair<int,int> &b){return a.ss>b.ss;} 
int gcd(int x,int y){return __gcd(x,y);}

void test_case(){
    int n,m;
    cin>>n>>m;
    vv h(n);
    fors(i,n){
        cin>>v[i];
    }
    bool visited[n]={false};
    int cnt[n]={0};
    for(int i=0;i<m;++i){
        int x,y;
        cin>>x>>y;
        --x,--y;
        visited[x]=true;
        visited[y]=true;
        if(h[x]>h[y]){cnt[x]=1;}
        if(h[y]>h[x]){cnt[y]=1;}
    }
    int c=0;
    for(int i=0;i<n;++i){
        if(!visited[i]){
            ++c;
        }
        if(cnt[i]){
            ++c;
        }
    }
    test(cnt);
}

int main(){
    fastio;
    file();
    int T=1;
    // int T;
    // cin>>T;
    for(int nr=1;nr<=T;++nr) {
        // cout<<"Case #"<<nr<<": ";
		test_case();
    }
}

Compiler output:
a.cc: In function 'void test_case()':
a.cc:36:14: error: 'v' was not declared in this scope
   36 |         cin>>v[i];
      |              ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
int main()
{
	ll N,M,A,B;
	cin >> N >> M;
	vector<ll> H(N);

	for(int i = 1,i<=N; i++){
		cin >> H[i];
	}

	set<ll> a;

	for(int i = 1; i<=M; i++){
		cin >> A >> B;
		if(H[A]>H[B]){
			a.insert(B);
		}
		else if(H[A]<H[B]){
			a.insert(A);
		}
		else{
			a.insert(A);
			a.insert(B);
		}
	}


	cout << N-a.size();


	cin >> N;
	
	return 0;	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:24: error: expected ';' before '<=' token
   11 |         for(int i = 1,i<=N; i++){
      |                        ^~
      |                        ;
a.cc:11:24: error: expected primary-expression before '<=' token
   11 |         for(int i = 1,i<=N; i++){
      |                        ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(void){
    // Your code here!
    long long N,M,X,Y,count;
    cin>>N>>M;
    long long H[N];
    for(long long i=0;i<N;i++){
        cin>>H[i];
    }
    long long A[M][2];
    for(long long i=0;i<M;i++){
        for(int j=0;j<2;j++){
            cin>>A[i][j];
        }
    }
    for(long long i=0;i<M-1;i++){
        if(H[A[i][0]]>H[A[i][1]]){
            Y=A[i][0];
        }
        if(H[A[i][0]]<H[A[i][1]]){
            Y=A[i][1];
        }
        X=max(H[A[i][0]],H[A[i][1]]);
        for(long long j=i+1;j<M;j++){
            if(Y==A[j][0]||Y==A[j][1]){
                if(H[Y]<max(H[A[j][0]],H[A[j][1]]){
                    break;
                }
            }
        }
        count++;    
        }
    }
    cout<<count<<endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:27:51: error: expected ')' before '{' token
   27 |                 if(H[Y]<max(H[A[j][0]],H[A[j][1]]){
      |                   ~                               ^
      |                                                   )
a.cc:30:13: error: expected primary-expression before '}' token
   30 |             }
      |             ^
a.cc: At global scope:
a.cc:35:5: error: 'cout' does not name a type
   35 |     cout<<count<<endl;
      |     ^~~~
a.cc:36:1: error: expected declaration before '}' token
   36 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int n,M;
  cin >> n >> M;
  vector<int64_t> h(n+1);
  vector<int> vec(1);
  for(int i=1;i<n+1;i++){
    cin >> h.at(i);
  }
  for(int i=1;i<M+1;i++){
    int A, B;
    cin >> A >> B;
    int x, y;
    if(h.at(A)>=h.at(B)){
      x=A;
      y=B;
    }
    else{
       x=B;
       y=A;
    }
    if(i==1){
      vec.at(0)=x;
    }
    for(int j=0;j<vec.size();j++){
      if(h.(vec.at(j))==h.at(y)){
        vec.at(j)=x;
        break;
      }
      if(j==vec.size()-1 && h.at(vec.at(j))!=h.at(y)){
        vec.push_back(x);
      }
    }
  }
         cout << vec.size() << endl;
         }
         
      
        
        
    
    

Compiler output:
a.cc: In function 'int main()':
a.cc:27:12: error: expected unqualified-id before '(' token
   27 |       if(h.(vec.at(j))==h.at(y)){
      |            ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,m,g=0,w=0,e=0;//個数、道の数
	cin>>n>>m;
	int H[n];//標高
	int a[2][m];
	int s[n];
	for(int i=0;i<n;i++){
		s[i]=0;
	}
	for(int i=0;i<n;i++){
		cin>>H[i];
	}
	for(int i=0;i<n-1;i++){
		for(int j=0;j<2;j++){
		cin>>a[j][i];
		}
	}
	for(int i=0;i<m;i++){
		if(w==0){
			if(s[a[w][i]-1]==0){
				s[a[w][i]-1]=1;
				if(H[a[w+1][i]-1]<H[a[w][i]-1]){
					g++;
				}
			}
		}
	}
	w=1;
	for(int i=0<i<m;i++){
		else{
			if(s[a[w+1][i]-1]==0){
				s[a[w+1][i]-1]=1;
				if(H[a[w+1][i]-1]>H[a[w][i]-1]){
					g++;
				}
			}
		}
	}
	printf("%d\n",g);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:28: error: expected ';' before ')' token
   31 |         for(int i=0<i<m;i++){
      |                            ^
      |                            ;
a.cc:32:17: error: 'else' without a previous 'if'
   32 |                 else{
      |                 ^~~~
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<cmath>
#include<map>
#include<iomanip>
#define rip(i,n) for(int i=0;i<n;i++)
#define ll long long
#define ld long double
#define set setprecision　//小数点以下何位まで知りたいか
#define mod 1000000007
#define pi 3.14159265
#include<numeric>
using namespace std;
int gcd(int a, int b)//最大公約数
{
	if (a % b == 0)	return(b);
	else return(gcd(b, a % b));
}
int lcm(int a, int b)//最小公倍数
{
	return a * b / gcd(a, b);
}
ll pow(ll a, ll b) {
	ll k = b % 30000, h = b / 30000, s = 1;
	rip(i, 30000)s = (s * a) % 2019; ll j = 1;
	if (h != 0)rip(i, h)j = j * s % 2019;
	if (k != 0)rip(i, k)j = j * a % 2019;
	return(j);
}
int main() {
	int n, m;
	cin >> n >> m;
	vector<int>h(n);
	int maxx= 0;
	int maxxx;
	rip(i, n)cin >> h[i];
	vector<pair<int, int>>a(m);
	for (int i = 0; i < m; i++) {
		cin >> a.at(i).first >> a.at(i).second;
	}
	int count = 0;
	rip(i, m) {
		if(h[a.at(i).first] = h[a.at(i).second]){
			h[a.at(i).first] = h[a.at(i).second] = 0;
		if (h[a.at(i).first] > h[a.at(i).second])h[a.at(i).second] = 0;
		else h[a.at(i).first] = 0;
	}
		rip(i, n) {
			if (h[i] != 0)count++;
		}
		cout << count << endl;
}

Compiler output:
a.cc:11:13: error: extended character 　 is not valid in an identifier
   11 | #define set setprecision　//小数点以下何位まで知りたいか
      |             ^
a.cc: In function 'int main()':
a.cc:54:2: error: expected '}' at end of input
   54 | }
      |  ^
a.cc:32:12: note: to match this '{'
   32 | int main() {
      |            ^
Language: C++

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

int main() {
    int N, M;
    cin >> N >> M;
    long long H[N-1];
    int ans;
    
    for (int i = 0; i < N; i++) cin >> H[i];

    multimap<int, int> mp;


    int a;
    int b;

    for (int i = 0; i < M; i++) {
        cin >> a >> b;
        mp.insert(make_pair(a,b));
        mp.insert(make_pair(b,a));
    }


    int A[M][1];
    for (int i = 0; i < M; i++) {
        bool flag = false;
        auto p = mp.equal_range(i);
        for (auto it = p.first; it != p.second; ++it) {
            if (H[i] < H[p.second]) {
                flag = false;
                break;
            }
            flag = true;
        }
        if (flag) {
            ans++;
        }
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:25: error: no match for 'operator[]' (operand types are 'long long int [(N + -1)]' and 'std::_Rb_tree_iterator<std::pair<const int, int> >')
   30 |             if (H[i] < H[p.second]) {
      |                         ^
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main(int argc, char const *argv[])
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int n, m, r = 0;
    cin >> n >> m;
    int oh[n + 1];
    vector<bool> o(n + 1, true);

    for (int i = 1; i <= n; ++i)
        cin >> oh[i];
    
    while (m--) {
        int o1, o2;
        cin >> o1 >> o2;
        if (oh[o1] < oh[o2]) o[o1] = false;
        else if (oh[o1] == oh[o2]) o[o1] = o[o2] = false
        else o[o2] = false;
    }

    for (vector<bool>::iterator it = o.begin() + 1; it < o.end(); ++it)
        r += *it;

    cout << r;

    return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:23:57: error: expected ';' before 'else'
   23 |         else if (oh[o1] == oh[o2]) o[o1] = o[o2] = false
      |                                                         ^
      |                                                         ;
   24 |         else o[o2] = false;
      |         ~~~~
Language: C

#include<iostream>
using namespace std;

int main()
{
    int n,m,i;
    
    cin>>n>>m;
    int str[n];
    for(i=0;i<n;i++){
    cin>>str[i];
    }
    int x[m],y[m],j,count=0;
    scanf("%d %d",&x[0],&y[0]);
    if(str[y[0]-1]>str[x[0]-1])
    count++;
    for(i=1;i<m;i++){
    scanf("%d %d",&x[i],&y[i]);
    for(j=0;j<i;j++){
    if(y[i]==y[j] && x[i]!=x[j])
    str[y[i]-1]=-1;
    }
    if(str[y[i]-1]>str[x[i]-1])
    count++;
    }
    cout<<count;
    
    
    
    
    return 0;
}

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

#include <iostream>
#include <algorithm>
#define rep(a,i,n) for(int i=(a);i<(n);i++)
typedef long long ll;
typedef struct{
	ll a;
	ll b;
} road;

using namespace std;

void set_zero(ll *a,ll n){
	rep(0,i,n){
		a[i] = 0;
	}
}

swap(ll *a,ll *b){
	ll tmp = *a;
	*a = *b;
	*b =tmp;
}

void swapt(road x){
	swap(x.a,x.b);
}

int main(){
	ll n,m,count=0;
	cin >> n >> m;
	ll h[n];
	road msd[m];

	set_zero(msd.a,m);
	set_zero(msd.b,m);

	rep(0,i,n){
		cin >> h[i];
	}

	rep(0,i,m){
		cin >> msd[i].a >> msd[i].b;
	}



	rep(0,i,n){
		rep(0,j,m){
			if(a==i+1 && h[i]<=h[b[j]-1]){
				break;
			}

			
			if(j == m-1){
				count++;
			}
		}
	}
	cout << count << endl;
}

Compiler output:
a.cc:18:1: error: ISO C++ forbids declaration of 'swap' with no type [-fpermissive]
   18 | swap(ll *a,ll *b){
      | ^~~~
a.cc: In function 'int swap(ll*, ll*)':
a.cc:22:1: warning: no return statement in function returning non-void [-Wreturn-type]
   22 | }
      | ^
a.cc: In function 'int main()':
a.cc:34:22: error: request for member 'a' in 'msd', which is of non-class type 'road [m]'
   34 |         set_zero(msd.a,m);
      |                      ^
a.cc:35:22: error: request for member 'b' in 'msd', which is of non-class type 'road [m]'
   35 |         set_zero(msd.b,m);
      |                      ^
a.cc:49:28: error: 'a' was not declared in this scope
   49 |                         if(a==i+1 && h[i]<=h[b[j]-1]){
      |                            ^
a.cc:49:46: error: 'b' was not declared in this scope
   49 |                         if(a==i+1 && h[i]<=h[b[j]-1]){
      |                                              ^
Language: C

#include<stdio.h>
int main()
{
int i;
int j;
int N;
int M;
int di;
int dj;
int takasa[100100];
int win[100100];
int count=0;

scanf("%d %d",&N,&M);

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

for(i=1;i<M+1;i++){
scanf("%d ",di);
scanf("%d ",dj);
if(takasa[di]>takasa[dj]){
win[dj]=0;
}else{win[di]=0;}

}

for(i=1;i<N+1;i++){
IF(win[i]==0){count++;}
}

printf("%d",count);

return 0;
}


Compiler output:
main.c: In function 'main':
main.c:31:1: error: implicit declaration of function 'IF' [-Wimplicit-function-declaration]
   31 | IF(win[i]==0){count++;}
      | ^~
main.c:31:14: error: expected ';' before '{' token
   31 | IF(win[i]==0){count++;}
      |              ^
      |              ;
Language: C++

#include <vector>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <numeric>

using namespace std;

int main(){
    int n, m;
    cin >> n >> m;

    vector<int> h(n,0);
    vector<bool> good(n,true);

    for(int i=0; i!=n; i++) cin >> h.at(i);
    int i1, i2;
    for(int i=0; i!=m; i++){
        cin >> i1 >> i2;
        i1--;
        i2--;
        good.at(i1) = h.at(i1) > h.at(i2);
        good.at(i2) = h.at(i2) > h.at(i1);
    }
    int out = 0;
    for(auto i : good) if(i) out++;
    cout << out << endl;
    return 0; 
}
/* 

Compiler output:
a.cc:30:1: error: unterminated comment
   30 | /*
      | ^
Language: Java

import java.util.Scanner;
public class main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		long H[] = new long[N+1];
		for (int i = 1; i < N+1; i++) {
			H[i] = sc.nextInt();
		}
		
		int michi[][] = new int[N+1][N+1];
		for (int i = 0; i < M; i++) {
			int N1 = sc.nextInt();
			int N2 = sc.nextInt();
		}
	}
}


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: C++

#include <bits/stdc++.h>

using namespace std;

typedef pair<int, int> P;
typedef long long ll;

ll N,M;
ll H[100000];
vector<P> path;
char d[100000][100000];

set<int> ans;

void solve(){
    for(ll i = 0; i < N; i++){
        for(ll j = 0; j < N; j++) d[i][j] = 0;
    }

    for(ll i = 0; i < M; i++){
        int a = path[i].first;
        int b = path[i].second;

        d[a][b] = 1;
        d[b][a] = 1;
    }
   
  
    for (int i = 0; i < N; i++)
    {
      
        bool ok = true;
        for (int j = 0; j < N; j++)
        {
            if(d[i][j] == 1 && H[j] >= H[i] ){
               ok = false;
               break;
            }
        }
        if(ok){
           
            ans.insert(i);
        }
    }
    cout << ans.size() << endl;
}


int main(){
    cin >> N >> M;
    for (int i = 0; i < N; i++)
    {
        cin >> H[i];
    }
    for (int i = 0; i < M; i++)
    {
        P p;
        cin >> p.first >> p.second;
        p.first -= 1;
        p.second -= 1;
        path.push_back(p);
    }
    


    
    solve();

    return 0;

}

Compiler output:
/tmp/ccQh0W4f.o: in function `solve()':
a.cc:(.text+0x19d): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccQh0W4f.o
a.cc:(.text+0x1cb): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccQh0W4f.o
/tmp/ccQh0W4f.o: in function `__static_initialization_and_destruction_0()':
a.cc:(.text+0x33c): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccQh0W4f.o
a.cc:(.text+0x355): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccQh0W4f.o
collect2: error: ld returned 1 exit status
Language: C++

#include <bits/stdc++.h>
#define ll long long
using namespace std;
int gcd(int x, int y) { return (x % y) ? gcd(y, x % y) : y; }
const double PI = 3.14159265358979323846;
int main() {
  int n, m;
  cin >> n >> m;
  ll h[n];
  for (int i = 0; i < n; i++) {
    cin >> h[i];
  }
  int a, b;
  vector<ll> maru, batu, marus, batus;
  for (int j = 0; j < m; j++) {
    cin >> a >> b;
    if (h[a - 1] > h[b - 1]) {
      maru.push_back(a);
      batu.push_back(b);
    }
    if (h[a - 1] < h[b - 1]) {
      batu.push_back(a);
      maru.push_back(b);
    }
    if (h[a - 1] == h[b - 1]) {
      maru.push_back(a);
      maru.push_back(b);
    }
  }
  ll ans = 0;
  sort(maru.begin(), maru.end());
  maru.erase(unique(maru.begin(), maru.end()), maru.end());
  sort(batu.begin(), batu.end());
  batu.erase(unique(batu.begin(), batu.end()), batu.end());
  for (int k = 0; k < maru.size(); k++) {
    ll con = 0;
    for (int l = 0; l < batu.size(); l++) {
      if (maru[k] == batu[l]) {
        con++;
      }
    }
    if (con == 0) {
      ans++;
    }
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:45:4: error: expected '}' at end of input
   45 |   }
      |    ^
a.cc:6:12: note: to match this '{'
    6 | int main() {
      |            ^
Language: C++

vector<vector<unsigned long long>> connect;
int ans = 0;
int n;

void ck(unsigned long long i) {
	for (int j = 0; j < n; j++) {
		if (i == j)continue;
		if (connect[i][j] == 1) {
			if (h[i] > h[j]) {
				ans++;
			}
			else {
			}
		}
		else continue;
	}
}


int main() {
	int  m;
	cin >> n >> m;
	vector<unsigned long long> a(m), b(m);
	h = vector<unsigned long long>(n);
	connect = vector<vector<unsigned long long>>(n, vector<unsigned long long>(n));
	for (int i = 0; i < m; i++) {
		cin >> h[i];
	}
	for (int i = 0; i < m; i++) {
		cin >> a[i] >> b[i];
		a[i]--;
		b[i]--;
	}
	for (int i = 0; i < m; i++) {
		connect[a[i]][b[i]] = 1;
		connect[b[i]][a[i]] = 1;
	}
	for (int i = 0; i < n; i++) {
		ck(i);
	}
	cout << ans;
	return 0;
}

Compiler output:
a.cc:1:1: error: 'vector' does not name a type
    1 | vector<vector<unsigned long long>> connect;
      | ^~~~~~
a.cc: In function 'void ck(long long unsigned int)':
a.cc:8:21: error: 'connect' was not declared in this scope; did you mean 'const'?
    8 |                 if (connect[i][j] == 1) {
      |                     ^~~~~~~
      |                     const
a.cc:9:29: error: 'h' was not declared in this scope
    9 |                         if (h[i] > h[j]) {
      |                             ^
a.cc: In function 'int main()':
a.cc:22:9: error: 'cin' was not declared in this scope
   22 |         cin >> n >> m;
      |         ^~~
a.cc:23:9: error: 'vector' was not declared in this scope
   23 |         vector<unsigned long long> a(m), b(m);
      |         ^~~~~~
a.cc:23:16: error: expected primary-expression before 'unsigned'
   23 |         vector<unsigned long long> a(m), b(m);
      |                ^~~~~~~~
a.cc:24:9: error: 'h' was not declared in this scope
   24 |         h = vector<unsigned long long>(n);
      |         ^
a.cc:24:20: error: expected primary-expression before 'unsigned'
   24 |         h = vector<unsigned long long>(n);
      |                    ^~~~~~~~
a.cc:25:9: error: 'connect' was not declared in this scope; did you mean 'const'?
   25 |         connect = vector<vector<unsigned long long>>(n, vector<unsigned long long>(n));
      |         ^~~~~~~
      |         const
a.cc:25:33: error: expected primary-expression before 'unsigned'
   25 |         connect = vector<vector<unsigned long long>>(n, vector<unsigned long long>(n));
      |                                 ^~~~~~~~
a.cc:30:24: error: 'a' was not declared in this scope
   30 |                 cin >> a[i] >> b[i];
      |                        ^
a.cc:30:32: error: 'b' was not declared in this scope
   30 |                 cin >> a[i] >> b[i];
      |                                ^
a.cc:35:25: error: 'a' was not declared in this scope
   35 |                 connect[a[i]][b[i]] = 1;
      |                         ^
a.cc:35:31: error: 'b' was not declared in this scope
   35 |                 connect[a[i]][b[i]] = 1;
      |                               ^
a.cc:41:9: error: 'cout' was not declared in this scope
   41 |         cout << ans;
      |         ^~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

typedef pair<int, int> P;
typedef long long ll;

ll N,M;
ll H[100000];
vector<P> path;
char d[100000][100000];

set<int> ans;

void solve(){
    for(ll i = 0; i < N; i++){
        for(ll j = 0; j < N; j++) d[i][j] = 0;
    }

    for(ll i = 0; i < M; i++){
        int a = path[i].first;
        int b = path[i].second;

        d[a][b] = 1;
        d[b][a] = 1;
    }
   
  
    for (int i = 0; i < N; i++)
    {
      
        bool ok = true;
        for (int j = 0; j < N; j++)
        {
            if(d[i][j] == 1 && H[j] >= H[i] ){
               ok = false;
               break;
            }
        }
        if(ok){
            cout <<"ok " << i << endl;
            ans.insert(i);
        }
    }
    cout << ans.size() << endl;
}


int main(){
    cin >> N >> M;
    for (int i = 0; i < N; i++)
    {
        cin >> H[i];
    }
    for (int i = 0; i < M; i++)
    {
        P p;
        cin >> p.first >> p.second;
        p.first -= 1;
        p.second -= 1;
        path.push_back(p);
    }
    


    
    solve();

    return 0;

}

Compiler output:
/tmp/ccse6gsA.o: in function `solve()':
a.cc:(.text+0x1d8): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccse6gsA.o
a.cc:(.text+0x206): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccse6gsA.o
/tmp/ccse6gsA.o: in function `__static_initialization_and_destruction_0()':
a.cc:(.text+0x377): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccse6gsA.o
a.cc:(.text+0x390): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccse6gsA.o
collect2: error: ld returned 1 exit status
Language: Java

import java.util.*;

class Main
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();
        int m = sc.nextInt();
        
        int[] hight = new int[n]; //高さ入力
        for (int i = 0; i < n; i++) {
            hight[i] = sc.nextInt();
        }
        
        int[] perfect = new int[n];  // 最高かどうか
        for (int i = 0; i < n; i++) {
            perfect[i] = 0;
        }
        
        int[] perfect2 = new int[n]; //登場回数
        for (int i = 0; i < n; i++) {
            perfect2[i] = 0;
        }
         
        
        for (int i = 0; i < m ; i++) {
            int a = sc.nextInt();
            int b = sc.nextInt();
            
            perfect2[a - 1] = 1;
            perfect2[b -1] = 1;
            
            
            if (hight[a - 1] > hight[b - 1]) {
                perfect[a -1] += 100;
                perfect[b - 1] -= 9999999;
            } else if (hight[a - 1] < hight[b - 1]) {
                perfect[b - 1] += 100;
                perfect[a - 1] -= 9999999;
            } else {
                perfect[b - 1] -= 9999999;
                perfect[a - 1] -= 9999999;
        }
        
        int count = 0;
        for (int i = 0; i < n; i++) {
            if (perfect[i] > 100) {
                count++;
            }
        }
        for (int i = 0; i < n; i++) {
            if (perfect2[i] == 0) {
                count++;
            }
        }
        
        System.out.println(count + 1);
    }
} 

Compiler output:
Main.java:61: error: reached end of file while parsing
} 
 ^
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
using P = pair<ll, ll>;
#define rep(i, n) for(int i=0;i<(int)n;i++)
#define PI acos(-1)
#define fast_io ios_base::sync_with_stdio(false) ; cin.tie(0); cout.tie(0);
ll mod=1e9+7;
#define int ll


int main(){
    fast_io
    
    int n,m;
    cin>>n>>m;
    vector<ll> h(n);
    rep(i,n) cin>>h[i];
    bool path[n][n];
    rep(i,n){
        rep(j,n){
            path[i][j]=true;
            //cout<<path[i][j]<<" ";
        }
        //cout<<endl;
    }

    rep(i,m){
        int a;
        int b;
        cin>>a>>b;
        a-=1;
        b-=1;
        if(h[a]<h[b]){
            path[a][b]=false;
        }else if(h[a]>h[b]){
            path[b][a]=false;
        }else{
            path[a][b]=false;
            path[b][a]=false;
        }
    }
    int ans=0;

    rep(i,n){
        bool flag=true;
        rep(j,n){
            if(i==j) continue;
            if(!path[i][j]) {
                flag=false;
                break;
            }
        }
        if(flag) ans++;
    }
    
    cout<<ans<<endl;
    
    return 0;
}

Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C

#include<stdio.h>
#include<string.h>
#include<math.h>
#include <stdlib.h>
#include<ctype.h>

//qsort
int compare_int(const void *a, const void *b)
{
    return *(int*)a - *(int*)b;
}

//比較
int max(int a, int b){
	if (a>b) return a;
	else return b;
}

int min(int a,int b) {
	if(a>b) return b;
	else return a;
}


//main関数
int main() {
	int N,M;
	scanf("%d %d",&N,&M);
	
	long long H[N];
	for(int i=0;i<N;i++) {
		scanf("%lld",&H[i]);
	}
	
	int A[2][M];
	for(int j=0;j<M;j++) {
		scanf("%d %d",&A[0][j],&A[1][j]);
	}
	
	
	int ans[N];
	for(int i=0;i<N;i++) {
		ans[i] = 0;
	}
	
	for(int i=0;i<M;i++){
		if( H[ A[0][i] - 1 ] >= H[ A[1][i] -1] ) {
			ans[A[1][i] -1] = 1;
		} 
		if( H[1][i] >= H[0][i] ) {
			ans[A[0][i] -1] = 1;
		} 
	}
	
	int sum = 0;
	for(int i=0;i<N;i++) {
		if(ans[i]==0){
			sum++;
		}
	}
	printf("%d",sum);
}

Compiler output:
main.c: In function 'main':
main.c:50:25: error: subscripted value is neither array nor pointer nor vector
   50 |                 if( H[1][i] >= H[0][i] ) {
      |                         ^
main.c:50:36: error: subscripted value is neither array nor pointer nor vector
   50 |                 if( H[1][i] >= H[0][i] ) {
      |                                    ^
Language: C

#include<stdio.h>
int main(){
    int n,m;
scanf("%d%d",&n,&m);
int elevation[n];
for(int i=0;i<n;i++){
    scanf("%d",&elevation[i]);
}
int a[n][n];
for(int i=0;i<n;i++){
    for(int j=0;j<n;j++){
        a[i][j]=0;
    }
}
int start,end;
for(int k=0;k<m;k++){
        scanf("%d%d",&start,&end);
        a[start][end]=1;
        a[end][start]=1;
}
int good_obs=0;
for(int i=0;i<n;i++){
    int flag1=0;
    int flag2=0;
    int j=0;
    while((j<n)!!((flag1==1)&&( flag2==1))){
        if(a[i][j]==1){
            flag1=1;
        }
        if((elevation[j]>elevation[i])&&(a[i][j]==1)){
            flag2=1;
        }
        j++;
    }
    if((flag1==0) || (flag2==0)){
            good_obs++;
    }
}
printf("%d",good_obs);
return 0;
}



Compiler output:
main.c: In function 'main':
main.c:26:16: error: expected ')' before '!' token
   26 |     while((j<n)!!((flag1==1)&&( flag2==1))){
      |          ~     ^
      |                )
Language: C++

#include <bits/stdc++.h>
using ll=long long;
using namespace std;
ll INF=1000000000000000001;
ll mod=1000000007;
 
ll i,j,k;
 
int main(){
    ll n,m;cin>>n>>m;
    vector<ll> h(n),a(m),b(m);
    vector<ll> ans(n,-1);
    vector<vector<ll>> G(n);
 
    for(i=0;i<n;i++){cin>>h[i];}
 
    for(i=0;i<m;i++){
        cin>>a[i]>>b[i];
        a[i]--;b[i]--;
 
        G[a[i]].push_back(b[i]);
        G[b[i]].push_back(a[i]);
    }//a,bが展望台を結ぶ
 
    
 
    ll answer=0;
    for(i=0;i<n;i++){
        if(ans[i]!=-1) continue;//すでにvisit
 
        answer++;
        int max1=h[i],max2=0;

        ll now=i;
        for(auto next:G[now]){
            if(ans[next]!=-1) continue;//訪れてしまっている
            
            ans[next]=1;

            if(max1==h[next]){max2=max(max2,max1);}
            else{max1=max(max1,h[next]);}
        }
        if(max1==max2){answer--;}
    }
       
 
    
 
    cout<<answer+1<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:41:26: error: no matching function for call to 'max(int&, __gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type&)'
   41 |             else{max1=max(max1,h[next]);}
      |                       ~~~^~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:41:26: note:   deduced conflicting types for parameter 'const _Tp' ('int' and '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'})
   41 |             else{max1=max(max1,h[next]);}
      |                       ~~~^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:41:26: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   41 |             else{max1=max(max1,h[next]);}
      |                       ~~~^~~~~~~~~~~~~~
Language: Java

import java.util.Scanner;
public class main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		long H[] = new long[N+1];
		for (int i = 1; i < N+1; i++) {
			H[i] = sc.nextInt();
		}
	}
}


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

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		int M = Integer.parseInt(sc.next());
		ArrayList<Integer> list = new ArrayList<>();
		for(int i = 0; i < N; i++) {
			list.add(Integer.parseInt(sc.next()));
		}
		ArrayList<Integer> ansList = new ArrayList<>(list);
		int[] A = new int[M];
		int[] B = new int[M];
		for(int i = 0; i < M; i++) {
			A[i] = Integer.parseInt(sc.next());
			B[i] = Integer.parseInt(sc.next());
		}

		for(int i = 0; i < M; i++) {
			int left = list.get(A[i] - 1);
			int right = list.get(B[i] - 1);
			int check = Math.min(left, right);
			if(ansList.contains(check)) {
				ansList.remove(ansList.indexOf(check));
			}
		}
		sc.close();
		System.out.println(ansList.size());
	}
}

Compiler output:
Main.java:9: error: cannot find symbol
		ArrayList<Integer> list = new ArrayList<>();
		^
  symbol:   class ArrayList
  location: class Main
Main.java:9: error: cannot find symbol
		ArrayList<Integer> list = new ArrayList<>();
		                              ^
  symbol:   class ArrayList
  location: class Main
Main.java:13: error: cannot find symbol
		ArrayList<Integer> ansList = new ArrayList<>(list);
		^
  symbol:   class ArrayList
  location: class Main
Main.java:13: error: cannot find symbol
		ArrayList<Integer> ansList = new ArrayList<>(list);
		                                 ^
  symbol:   class ArrayList
  location: class Main
4 errors
Language: C++

#include<cmath>
using namespace std;
int a[100003],ch[100003];
int main()
{
int n,m;
cin>>n>>m;
 
for(int i=0;i<n;i++)
{
    cin>>a[i];
    ch[i]=1000000003;
}
for(int i=0;i<m;i++)
{
    int x,y;
    cin>>x>>y;
    x--;y--;
    ch[x]=min(ch[x],a[y]);
    ch[y]=min(ch[y],a[x]);
}
for(int i=0;i<n;i++)
{
    if(ch[i]==1000000003)
    {
        ch[i]=0;
    }
}
int cnt=0;
for(int i=0;i<n;i++)
{
    if(ch[i]<a[i])
    {
        cnt++;
    }
}
cout<<cnt;
 
 return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:1: error: 'cin' was not declared in this scope
    7 | cin>>n>>m;
      | ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include<cmath>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:37:1: error: 'cout' was not declared in this scope
   37 | cout<<cnt;
      | ^~~~
a.cc:37:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: Java

import java.util.Scanner;
public class main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		long H[] = new long[N+1];
		for (int i = 1; i < N+1; i++) {
			H[i] = sc.nextInt();
		}
		
		int michi[][] = new int[N+1][N+1];
		for (int i = 0; i < M; i++) {
			int N1 = sc.nextInt();
			int N2 = sc.nextInt();
			michi[N1][N2] = 1;
			michi[N2][N1] = 1;
		}
		
	}
}


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: C++

#include <bits/stdc++.h>
using namespace std;
//NOT TO SUBMIT IN WRONG PLACE OR BY WRONG COMPILER
//ABC 166, task , 2020/05/03
//ms,
/*
*/

int main(void){
  int64_t N, M;
  vector<int64_t> height(10000);
  int64_t A, B;
  vector<vector<int64_t>> connect(10000);
  int ans=0;

  cin >>N >>M;
  for(int64_t i=0;i<N;i++) cin >>height[i];
  for(int64_t i=0;i<M;i++){
    cin >>A >>B;
    connect[A-1].push_back(B-1);
    connect[B-1].push_back(A-1);
  }

  for(int64_t i=0;i<N;i++){
    for(size_type j=0;j<connect[i].size();j++){
      //cout <<i <<j <<endl;
      if(height[i]<=height[connect[i][j]]) goto NEXT_LOOP;
    }
    ans++;
    //cout <<i <<endl;
    NEXT_LOOP:continue;
  }

  cout <<ans <<endl;

  return 0;
}
/*
*/


Compiler output:
a.cc: In function 'int main()':
a.cc:25:9: error: 'size_type' was not declared in this scope; did you mean 'size_t'?
   25 |     for(size_type j=0;j<connect[i].size();j++){
      |         ^~~~~~~~~
      |         size_t
a.cc:25:23: error: 'j' was not declared in this scope
   25 |     for(size_type j=0;j<connect[i].size();j++){
      |                       ^
Language: Java

import java.util.*;
import java.math.*;
     
class Main{
    public static void main(String[] args) {
        
        try(Scanner sc = new Scanner(System.in)){
 
            long n = Long.parseLong(sc.next());
            long m = Long.parseLong(sc.next());
 
            HashMap<Long, Long> height = new HashMap<>();
            HashSet<Long> bad = new HashSet<>();
 
            for(long i = 1; i < n + 1; i++){
                height.set((Long)i, (Long)Long.parseLong(sc.next()));
            }
 
            for(int j = 0; j < m; j++){
                long a = Long.parseLong(sc.next());
                long b = Long.parseLong(sc.next());

                if(height.get(a) > height.get(b)) {
                    if(bad.add(b)) n--;
                }else if(height.get(a) == height.get(b)){
                    if(bad.add(a)) n--;
                    if(bad.add(b)) n--;
                }else {
                    if(bad.add(a)) n--;
                }
            }
 
            System.out.println(n);
 
        }catch(Exception e){
            e.printStackTrace();
        }        
    }
}

Compiler output:
Main.java:16: error: cannot find symbol
                height.set((Long)i, (Long)Long.parseLong(sc.next()));
                      ^
  symbol:   method set(Long,Long)
  location: variable height of type HashMap<Long,Long>
1 error
Language: Java

import java.util.*;
import java.math.*;
     
class Main{
    public static void main(String[] args) {
        
        try(Scanner sc = new Scanner(System.in)){
 
            long n = Long.parseLong(sc.next());
            long m = Long.parseLong(sc.next());
 
            HashMap<Long, Long> height = new HashMap<>();
            HashSet<Long> bad = new HashSet<>();
 
            for(int i = 1; i < n + 1; i++){
                height.set((Long)i, (Long)Long.parseLong(sc.next()));
            }
 
            for(int j = 0; j < m; j++){
                long a = Long.parseLong(sc.next());
                long b = Long.parseLong(sc.next());

                if(height.get(a) > height.get(b)) {
                    if(bad.add(b)) n--;
                }else if(height.get(a) == height.get(b)){
                    if(bad.add(a)) n--;
                    if(bad.add(b)) n--;
                }else {
                    if(bad.add(a)) n--;
                }
            }
 
            System.out.println(n);
 
        }catch(Exception e){
            e.printStackTrace();
        }        
    }
}

Compiler output:
Main.java:16: error: incompatible types: int cannot be converted to Long
                height.set((Long)i, (Long)Long.parseLong(sc.next()));
                                 ^
1 error
Language: C++

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

int main()
{
  int N,M;
  vector<long int> H(10000);
  vector<int> A(10000);
  vector<int> B(10000);
  vector<int> chk(10000);
  cin >> N >> M;
  for(int i=0; i<N; i++)
  {
    cin >> H.at(i);
  }
  for(int i=0; i<M; i++)
  {
    cin >> A.at(i) >>B.at(i);
  }
  for(int i=0; i<M; i++)
  {
    if(H.at(A.at(i))>H.at(B.at(i)))
    {
      chk.at(A.at(i))++;
      chk.at(B.at(i))-=9999;
    }
    if(H.at(A.at(i))<H.at(B.at(i)))
    {
      chk.at(B.at(i))++;
      chk.at(A.at(i))-=9999;
    }
    int count=0;
    for(int i=0; i<N; i++)
    {
      if(chk.at(i)>=0)
      {
        count++;
      }
    }
  cout << count << endl;
}

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

#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main(){
  int N,M;
  cin >>N>>M;
  ll count=0;
  vector<int> H(N);
  vector<int> A(M);
  vector<int> B(M);
  bool ans=true;

  
  //展望台高さ登録
  for(int i=0;i<N;i++){
    cin >> H.at(i);
  }
  
  //橋登録
  for(int i=0;i<M;i++){
    cin >> A.at(i) >> B.at(i);
    A.at(i)--;B.at(i)--;
  }
  //橋の相手が高いければfalse
  for(int i=0;i<N;i++){
    for(int j=0;j<M;j++){
      if(A.at(j)==i){
        if(H.at(B.at(j))==-1){ans=false;break;}
        if(H.at(B.at(j))>=H.at(i)){ans=false;}
      }
      if(B.at(j)==i){
        if(H.at(A.at(j))==-1){ans=false;break;}
        if(H.at(A.at(j))>=H.at(i)){ans=false;}
      }   
    }
    if(ans){count++;H.at(i)=-1}
    ans=true;
  }
  cout <<count <<endl; 
}


Compiler output:
a.cc: In function 'int main()':
a.cc:37:31: error: expected ';' before '}' token
   37 |     if(ans){count++;H.at(i)=-1}
      |                               ^
      |                               ;
Language: Java

import java.util.*;
import java.math.*;
     
class Main{
    public static void main(String[] args) {
        
        try(Scanner sc = new Scanner(System.in)){
 
            long n = Long.parseLong(sc.next());
            long m = Long.parseLong(sc.next());
 
            HashMap<Long, Long> height = new HashMap<>();
            HashSet<Long> bad = new HashSet<>();
 
            for(long i = 0; i < n; i++){
                height.set(i + 1, Long.parseLong(sc.next()));
            }
 
            for(int j = 0; j < m; j++){
                long a = Long.parseLong(sc.next());
                long b = Long.parseLong(sc.next());

                if(height.get(a) > height.get(b)) {
                    if(bad.add(b)) n--;
                }else if(height.get(a) == height.get(b)){
                    if(bad.add(a)) n--;
                    if(bad.add(b)) n--;
                }else {
                    if(bad.add(a)) n--;
                }
            }
 
            System.out.println(n);
 
        }catch(Exception e){
            e.printStackTrace();
        }        
    }
}

Compiler output:
Main.java:16: error: cannot find symbol
                height.set(i + 1, Long.parseLong(sc.next()));
                      ^
  symbol:   method set(long,long)
  location: variable height of type HashMap<Long,Long>
1 error
Language: C

#include <stdio.h>

int main() {
 int n,m,height,i,x,y;
 int ans;
 
 scanf("%d %d", &n, &m);
 
 int s[n];
 for(i = 0; i < n; i++) {
   scanf("%d", &height);
   s[i] = height;
 }
 
 int x[n];
 int y[n];
 for(i = 0; i < m; i++) {
   scanf("%d %d", &x, &y);
   x[i] = 1;
   if (!(s[x - 1] == s[y - 1]))
     y[i] = 2;
 }
 
 ans = 0;
 for(i = 0; i < n; i++) {
   if ((x[i] == 0 && y[i] == 0) || y[i] == 2)
     ans++;
 }

 printf("%d", ans);
 return(0);
}

Compiler output:
main.c: In function 'main':
main.c:15:6: error: conflicting types for 'x'; have 'int[n]'
   15 |  int x[n];
      |      ^
main.c:4:19: note: previous declaration of 'x' with type 'int'
    4 |  int n,m,height,i,x,y;
      |                   ^
main.c:16:6: error: conflicting types for 'y'; have 'int[n]'
   16 |  int y[n];
      |      ^
main.c:4:21: note: previous declaration of 'y' with type 'int'
    4 |  int n,m,height,i,x,y;
      |                     ^
Language: Java

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

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

        Map<Integer, Integer> H = new HashMap<>();
        Map<Integer, Boolean> check = new HashMap<>();

        for (int i = 0; i < N; i++) {
            H.put(i + 1, scanner.nextInt());
            check.put(i + 1, false);
        }

        for (int i = 0; i < M; i++) {
            int A = scanner.nextInt();
            int B = scanner.nextInt();

            if (H.get(A) > H.get(B)) {
                check.put(A, true);
                check.put(B, false);
            } else {
                check.put(B, true);
                check.put(A, false);
            }
        }

        int result = 0;
        for (Integer integer : check.keySet()) {
            if (check.get(integer).equals(true)) {
                result += 1;
            }
        }

        System.out.println(result);
    }


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