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

#include <iostream>
#include <vector>
#include <unordered_map>

using namespace std;

int main(){
	
  int n, m, h;
  unordered_map<int, int> n;
  cin >> n >> m;
  
 for(int i = 0; i < n; i++){
 	cin >> h;
   m[i + 1] = h;
 }
  vector<bool> good(n, true);
 for(int i = 0; i < m; i++){
 	int a, b;
   cin >> a >> b;
   if(m[a] < m[b])good[a - 1] = false;
 }
  
  int res = 0;
  
  for(auto v : good){
  	
    if(v == true)res++;
  }
  
  cout << res << endl;
   
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:27: error: conflicting declaration 'std::unordered_map<int, int> n'
   10 |   unordered_map<int, int> n;
      |                           ^
a.cc:9:7: note: previous declaration as 'int n'
    9 |   int n, m, h;
      |       ^
a.cc:15:5: error: invalid types 'int[int]' for array subscript
   15 |    m[i + 1] = h;
      |     ^
a.cc:21:8: error: invalid types 'int[int]' for array subscript
   21 |    if(m[a] < m[b])good[a - 1] = false;
      |        ^
a.cc:21:15: error: invalid types 'int[int]' for array subscript
   21 |    if(m[a] < m[b])good[a - 1] = false;
      |               ^
Language: C++

#include <iostream>
#define rep(a,i,n) for(int i=(a);i<(n);i++)
#define ZERO 0
typedef long long ll;
using namespace std;

void set_one(int *a,int n){
	rep(0,i,n){
		a[i] = 1;
	}
}

int main(){
	ll n,m,count=0;
	cin >> n >> m;

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

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

	ll s[n];
	set_one(s,n);

	rep(0,i,m){
		if(h[a[i]-1] > h[b[i]-1])
			s[b[i]-1] = ZERO;
		else if(h[a[i]-1] < h[b[i]-1])
			s[a[i]-1] = ZERO;
		else if(h[a[i]-1] == h[b[i]-1]){
			s[a[i]-1] = ZERO;
			s[b[i]-1] = ZERO;
		}
	}

	rep(0,i,n){
		if(s[i] != ZERO)
			count++;
	}
	cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:17: error: cannot convert 'll*' {aka 'long long int*'} to 'int*'
   28 |         set_one(s,n);
      |                 ^
      |                 |
      |                 ll* {aka long long int*}
a.cc:7:19: note:   initializing argument 1 of 'void set_one(int*, int)'
    7 | void set_one(int *a,int n){
      |              ~~~~~^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(){
  int N,M;
  cin >> N >> M;
  int H[N],high[N],A[M],B[M];
  for(int i=0;i<N;i++){
    cin >> H[i];
    high[i]=1;
  }
  
  for(i=0;i<M;i++){
    cin >> A[i] >> B[i];
  }
  
  for(int i=0;i<M;i++){
    if(H[A[i]]<H[B[i]]){
      high[A[i]]=0;
    }
    else if(H[A[i]]>H[B[i]]){
      high[B[i]]=0;
    }
    else{
      high[A[i]]=0;
      high[B[i]]=0;
    }
  }
  int ans=0;
  for(int i=0;i<M;i++){
    ans+=high[i];
  }
  
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:7: error: 'i' was not declared in this scope
   14 |   for(i=0;i<M;i++){
      |       ^
Language: C++

#include <iostream>
#include <vector>
#define rep(i,n) for (int i=0; i<(n); i++)
using namespace std;

int main()
{
	int n, m, ans;
	cin >> n >> m;
	vector<int> h(n);
	vector<bool> good(n, false);
	rep (i, n) {
		cin >> h.at(i);
	}
	rep (i, n) {
		int a, b;
		cin >> a >> b;
		a--; b--;
		if (h.at(a) <= h.at(b)) good(a) = false;
		if (h.at(b) <= h.at(a)) good(b) = false;
	}
	for (auto a : good) if (a) ans++;

	cout << ans << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:45: error: no match for call to '(std::vector<bool>) (int&)'
   19 |                 if (h.at(a) <= h.at(b)) good(a) = false;
      |                                         ~~~~^~~
a.cc:20:45: error: no match for call to '(std::vector<bool>) (int&)'
   20 |                 if (h.at(b) <= h.at(a)) good(b) = false;
      |                                         ~~~~^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N, M;
  cin >> N >> M;
  
  vector<int> hight(N);
  for (int i = 0; i < N; i++) {
    cin >> hight.at(i);
  }
  
  vector<int> ans(N);
  
  vector<int> road(2);
  for (int i = 0; i < M; i++) {
    cin >> road.at(0) >> road.at(1);
    if (hight.at(road.at(0) - 1) > hight.at(road.at(1) - 1)) {
      ans.at(road.at(1) - 1)--;
    }
    if (hight.at(road.at(0) - 1) < hight.at(road.at(1) - 1)) {
      ans.at(road.at(0) - 1)--;
    }
    if (hight.at(road.at(0) - 1) == hight.at(road.at(1) - 1)) {
      ans.at(road.at(0) - 1)--;
      ans.at(road.at(1) - 1)--;
    
  }
  
  int answer = 0;
  for (int i = 0; i < N; i++) {
    if (ans.at(i) == 0) {
      answer++;
    }
  }
  
  cout << answer << endl;
}

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

#include<bits/stdc++.h >
using namespace std;
deque < int > edge[1000005];
int h[1000005];
int main()
{
	int n,m;
    cin>>n>>m;
    for(int i = 1; i<=n; i++)
    	cin>>h[i];
	for(int i = 0; i<m; i++)
	{
		int u,v;
		cin>>u>>v;
		edge[u].push_back(v);
		edge[v].push_back(u);
	}
	int cnt=0;
	for(int i=1;i<=n;i++)
	{
		bool flag=true;
		int sz=edge[i].size();
		for(int c=0;c<sz;c++)
		{
			if(h[i]==h[c])
			{
				flag=false;
				break;
			}
		}
		cnt+=flag;
	}
	cout<<cnt<<endl;
	return 0;
}

Compiler output:
a.cc:1:9: fatal error: bits/stdc++.h : No such file or directory
    1 | #include<bits/stdc++.h >
      |         ^~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h >
using namespace std;
deque < int > edge[1000005];
int h[1000005];
int main()
{
	int n,m;
    cin>>n>>m;
    for(int i = 1; i = n; i++)
    	cin>>h[i];
	for(int i = 0; i<m; i++)
	{
		int u,v;
		cin>>u>>v;
		edge[u].push_back(v);
		edge[v].push_back(u);
	}
	int cnt=0;
	for(int i=1;i<=n;i++)
	{
		bool flag=true;
		for(int to=0;to<edge[i].size();to++)
		{
			if(h[i]==h[to])
			{
				flag=false;
				break;
			}
		}
		cnt+=flag;
	}
	cout<<cnt<<endl;
	return 0;
}

Compiler output:
a.cc:1:9: fatal error: bits/stdc++.h : No such file or directory
    1 | #include<bits/stdc++.h >
      |         ^~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h >
using namespace std;
deque < int > edge[1000005];
int h[1000005];
int main()
{
	int n,m;
    cin>>n>>m;
    for(int i = 1; i = n; i++)
    	cin>>h[i];
	for(int i = 0; i<m; i++)
	{
		int u,v;
		cin>>u>>v;
		edge[u].push_back(v);
		edge[v].push_back(u);
	}
	int cnt=0;
	for(int i=1;i<=n;i++)
	{
		bool flag=true;
		for(int to=0;to<edge[i];to++)
		{
			if(h[i]==h[to])
			{
				flag=false;
				break;
			}
		}
		cnt+=flag;
	}
	cout<<cnt<<endl;
	return 0;
}

Compiler output:
a.cc:1:9: fatal error: bits/stdc++.h : No such file or directory
    1 | #include<bits/stdc++.h >
      |         ^~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#includebitsstdc++.h 
using namespace std;
deque < int > eage[1000005];
int h[1000005];
int main()
{
	int n,m;
    cin>>n>>m;
    for(int i = 1; i = n; i++)
    	cin>>h[i];
	for(int i = 0; i  m; i++)
	{
		int u,v;
		cin>>u>>v;
		edge[u].push_back(v);
		edge[v].push_back(u);
	}
	int cnt=0;
	for(int i=1;i<=n;i++)
	{
		bool flag=true;
		for(int to=0;to<eage[i];to++)
		{
			if(h[i]==h[to])
			{
				flag=false;
				break;
			}
		}
		cnt+=flag;
	}
	cout<<cnt<<endl;
	return 0;
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #includebitsstdc
    1 | #includebitsstdc++.h
      |  ^~~~~~~~~~~~~~~
a.cc:3:1: error: 'deque' does not name a type
    3 | deque < int > eage[1000005];
      | ^~~~~
a.cc: In function 'int main()':
a.cc:8:5: error: 'cin' was not declared in this scope
    8 |     cin>>n>>m;
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #includebitsstdc++.h
a.cc:11:25: error: expected ';' before 'm'
   11 |         for(int i = 0; i  m; i++)
      |                         ^ ~
      |                         ;
a.cc:11:28: error: expected ')' before ';' token
   11 |         for(int i = 0; i  m; i++)
      |            ~               ^
      |                            )
a.cc:11:30: error: 'i' was not declared in this scope
   11 |         for(int i = 0; i  m; i++)
      |                              ^
a.cc:22:33: error: 'eage' was not declared in this scope
   22 |                 for(int to=0;to<eage[i];to++)
      |                                 ^~~~
a.cc:32:9: error: 'cout' was not declared in this scope
   32 |         cout<<cnt<<endl;
      |         ^~~~
a.cc:32:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:32:20: error: 'endl' was not declared in this scope
   32 |         cout<<cnt<<endl;
      |                    ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #includebitsstdc++.h
Language: C++

int main(){
  int n,m;
  int i;
  ll H[100001];
  ll A[100001];
  ll B[100001];
  ll countGood=0;
  bool existM[100001];
  
    
  cin >> n >> m;
  rep1(i,n){
    cin >> H[i];
  }
  rep1(i,m){
    cin >> A[i] >> B[i];
  }
  rep1(i,n){
   existM[i] = true; 
  }
  
  rep1(i,m){
     if(H[A[i]] > H[B[i]]){
       existM[B[i]] = false;
     }
     else if(H[A[i]] < H[B[i]]){
       existM[A[i]] = false;
     }
     else{
       existM[A[i]] = false;
       existM[B[i]] = false;
     }
  }
  
  rep1(i,n){
    if(existM[i])
      countGood++;
  }
  cout << countGood << endl;
  
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:3: error: 'll' was not declared in this scope
    4 |   ll H[100001];
      |   ^~
a.cc:5:5: error: expected ';' before 'A'
    5 |   ll A[100001];
      |     ^~
      |     ;
a.cc:6:5: error: expected ';' before 'B'
    6 |   ll B[100001];
      |     ^~
      |     ;
a.cc:7:5: error: expected ';' before 'countGood'
    7 |   ll countGood=0;
      |     ^~~~~~~~~~
      |     ;
a.cc:11:3: error: 'cin' was not declared in this scope
   11 |   cin >> n >> m;
      |   ^~~
a.cc:12:3: error: 'rep1' was not declared in this scope
   12 |   rep1(i,n){
      |   ^~~~
a.cc:39:3: error: 'cout' was not declared in this scope
   39 |   cout << countGood << endl;
      |   ^~~~
a.cc:39:11: error: 'countGood' was not declared in this scope
   39 |   cout << countGood << endl;
      |           ^~~~~~~~~
a.cc:39:24: error: 'endl' was not declared in this scope
   39 |   cout << countGood << endl;
      |                        ^~~~
Language: C++

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

int main(){
  int N, M;
  int count = 0;
  cin >> N >> M;
  
  vector<int> height(N);
  vector<int> out(N) = {};
  vector<vector<int>> path(M, vector<int>(2));
  
  for(int i=0; i<N; i++){
    cin >> height.at(i);
    out.at(i) = 1;
  }
  
  for(int i=0; i<M; i++){
    for(int j=0; j<2; j++){
      cin >> path.at(i).at(j);
    }
  }
  
  for(int i=0; i<M; i++){
    if(height.at(path.at(i).at(0) -1) > height.at(path.at(i).at(1) -1)){
      out.at(path.at(i).at(1) -1) = 0;
    }
    else if(height.at(path.at(i).at(0) -1) < height.at(path.at(i).at(1) -1)){
      out.at(path.at(i).at(0) -1) = 0;
    }
    else if(height.at(path.at(i).at(0) -1) == height.at(path.at(i).at(1) -1)){
      out.at(path.at(i).at(0) -1) = 0;
      out.at(path.at(i).at(1) -1) = 0;
    }
  }
    
    //outの非ゼロの要素数を出力
  for(int i=0; i<N; i++){
    if(out.at(i) != 0){
      count++;
    }
  }
    
  cout << count << endl;
}


  


Compiler output:
a.cc: In function 'int main()':
a.cc:10:22: error: expected ',' or ';' before '=' token
   10 |   vector<int> out(N) = {};
      |                      ^
Language: C++

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

int main(){
  int N, M, count;
  cin >> N >> M;
  
  vector<int> height(N);
  vector<int> out(N);
  vector<vector<int>> path(N, vector<int>(2));
  
  for(int i=0; i<N; i++){
    cin >> height.at(i);
    out.at(i) = 1;
  }
  
  for(int i=0; i<M; i++){
    for(int j=0; j<2; j++){
      cin >> path.at(i).at(j);
    }
  }
  
  for(int i=0; i<M; i++){
    if(height.at(path.at(i).at(1)) > height.at(path.at(i).at(2))){
      out.at(path.at(i).at(2)) = 0;
    }
    else if(height.at(path.at(i).at(1)) < height.at(path.at(i).at(2))){
      out.at(path.at(i).at(1)) = 0;
    }
    else if(height.at(path.at(i).at(1)) == height.at(path.at(i).at(2))){
      out.at(path.at(i).at(1)) = 0;
      out.at(path.at(i).at(2)) = 0;
    }
    
    //outの非ゼロの要素数を出力
  for(int i=0; i<N; i++){
    if(height.at(i) != 0){
      count++;
    }
  }
    
  cout << count << endl;
}


  


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

#include <string>
#include <vector>

using namespace std;

struct Tower {
  int id;
  vector<Tower *> connections;
  int height = {0};

  Tower(int id, int height) : id(id), height(height) {
    id = id;
    height = height;
  }
};

int main() {
  int N, M;
  cin >> N >> M;

  // 展望台の初期化
  map<int, Tower *> tower_map;
  for (auto i = 0; i < N; i++) {
    int id = i + 1;
    int height;
    cin >> height;
    tower_map[id] = new Tower(id, height);
  }
  for (auto i = 0; i < M; i++) {
    int a_i, b_i;
    cin >> a_i;
    cin >> b_i;

    Tower *a, *b;
    a = tower_map[a_i];
    b = tower_map[b_i];
    a->connections.push_back(b);
    b->connections.push_back(a);
  }

  int count(0);
  for (const auto &tower : tower_map) {
    int height = tower.second->height;

    if (tower.second->connections.empty()) {
      count++;
    }
    for (const auto &connections : tower.second->connections) {
      if (connections->height > height) {
        count++;
        break;
      }
    }
  }
  cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:3: error: 'cin' was not declared in this scope
   19 |   cin >> N >> M;
      |   ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include <vector>
  +++ |+#include <iostream>
    3 | 
a.cc:22:3: error: 'map' was not declared in this scope
   22 |   map<int, Tower *> tower_map;
      |   ^~~
a.cc:3:1: note: 'std::map' is defined in header '<map>'; this is probably fixable by adding '#include <map>'
    2 | #include <vector>
  +++ |+#include <map>
    3 | 
a.cc:22:7: error: expected primary-expression before 'int'
   22 |   map<int, Tower *> tower_map;
      |       ^~~
a.cc:27:5: error: 'tower_map' was not declared in this scope
   27 |     tower_map[id] = new Tower(id, height);
      |     ^~~~~~~~~
a.cc:35:9: error: 'tower_map' was not declared in this scope
   35 |     a = tower_map[a_i];
      |         ^~~~~~~~~
a.cc:42:28: error: 'tower_map' was not declared in this scope
   42 |   for (const auto &tower : tower_map) {
      |                            ^~~~~~~~~
a.cc:55:3: error: 'cout' was not declared in this scope
   55 |   cout << count << endl;
      |   ^~~~
a.cc:55:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:55:20: error: 'endl' was not declared in this scope
   55 |   cout << count << endl;
      |                    ^~~~
a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    2 | #include <vector>
  +++ |+#include <ostream>
    3 |
Language: Java

import java.util.*;
import java.util.stream.*;

class Main {
  public static void main(String[] args) {
    var scanner = new Scanner(System.in);
    var N = scanner.nextInt();
    var M = scanner.nextInt();
    var height = new int[N+1];
    var good = new int[N+1];
    Arrays.fill(good, 1);
    good[0] = 0;
    for(int i = 1; i <= K; i++) {
      height[i] = scanner.nextInt();
    }
    for(int i = 1; i <= M; i++) {
      var v = scanner.nextInt();
      var w = scanner.nextInt();
      if(height[v] < height[w]) good[v] = 0;
      if(height[w] < height[v]) good[w] = 0;
    }
    var target = Arrays.stream(good).sum();
	System.out.println(target);
  }
}


Compiler output:
Main.java:13: error: cannot find symbol
    for(int i = 1; i <= K; i++) {
                        ^
  symbol:   variable K
  location: class Main
1 error
Language: Java

import java.util.*;
import java.util.stream.*;

class Main {
  public static void main(String[] args) {
    var scanner = new Scanner(System.in);
    var N = scanner.nextInt();
    var M = scanner.nextInt();
    var height = new int[N+1];
    var good = new int[N+1];
    Arrays.fill(good, 1);
    good[0] = 0;
    for(int i = 1; i <= K; i++) {
      height[i] = scanner.nextInt();
    }
    for(int i = 1; i <= M; i++) {
      var v = scanner.nextInt();
      var w = scanner.nextInt();
      if(height[v] < height[w]) good[v] = 0;
      if(height[w] < height[v]) good[w] = 0;
    }
    var target = Arrays.stream(candy).sum();
	System.out.println(target);
  }
}


Compiler output:
Main.java:13: error: cannot find symbol
    for(int i = 1; i <= K; i++) {
                        ^
  symbol:   variable K
  location: class Main
Main.java:22: error: cannot find symbol
    var target = Arrays.stream(candy).sum();
                               ^
  symbol:   variable candy
  location: class Main
2 errors
Language: C

4
|
3
Code:

#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <cstdio>
#include <string>
#include <cmath>
#include <cstring>
#include <iostream>
#include <algorithm>

#define x first
#define y second

//#define int long long

using namespace std;

//typedef int long long;
typedef pair<int,int>PII;

const int maxn = 2e5 + 10;

int t,n,m;


int main(void) {
	scanf("%d",&n);
	for(int i = -120; i <= 120; i ++) {
		for(int j = -120; j <= 120; j ++) {
			if(pow(i,5) - pow(j,5) == n) {
				printf("%d %d\n",i,j);
				return 0;
			}
		}
	}
	return 0;	
} 

Compiler output:
main.c:1:1: error: expected identifier or '(' before numeric constant
    1 | 4
      | ^
main.c:6:10: fatal error: set: No such file or directory
    6 | #include <set>
      |          ^~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
typedef long long ll;
#define _GLIBCXX_DEBUG
typedef vector<int> vec;
typedef vector<ll> lvec;
typedef vector<char>cvec;
typedef pair<ll, ll> LP;
typedef tuple<ll, ll, ll> LT;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;
int main()	{
  int n,m;
  cin>>n>>m;
  vector<int>h(n),d(n),a(m),b(m);
  rep(i,n) {
    cin>>h[i];
    d[i]++;
  }
  rep(i,m){
    cin>>a[i]>>b[i];
    a[i]--;
    b[i]--;
  }
  rep(i,m){
    int p=min(h[a[i]],h([b[i]]);
    d[p]=0;
  }
  int ans=0;
  rep(i,n){
    if(d[i])
      ans++;
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:27: error: expected ',' before '[' token
   29 |     int p=min(h[a[i]],h([b[i]]);
      |                           ^
      |                           ,
a.cc:29:27: error: expected identifier before '[' token
a.cc: In lambda function:
a.cc:29:31: error: expected '{' before ')' token
   29 |     int p=min(h[a[i]],h([b[i]]);
      |                               ^
a.cc: In function 'int main()':
a.cc:29:24: error: no match for call to '(std::vector<int>) (main()::<lambda()>)'
   29 |     int p=min(h[a[i]],h([b[i]]);
      |                       ~^~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
typedef long long ll;
#define _GLIBCXX_DEBUG
typedef vector<int> vec;
typedef vector<ll> lvec;
typedef vector<char>cvec;
typedef pair<ll, ll> LP;
typedef tuple<ll, ll, ll> LT;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;
int main()	{
  int n,m;
  cin>>n>>m;
  vector<int>h(n),d(n),a(m),b(m);
  rep(i,n) {
    cin>>h[i];
    d[i]++;
  }
  rep(i,m){
    cin>>a[i]>>b[i];
    a[i]--;
    b[i]--;
  }
  rep(i,m){
    int p=min(h[a[i]],h[[b[i]]);
    d[p]=0;
  }
  int ans=0;
  rep(i,n){
    if(d[p])
      ans++;
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:24: error: two consecutive '[' shall only introduce an attribute before '[' token
   29 |     int p=min(h[a[i]],h[[b[i]]);
      |                        ^
a.cc:34:10: error: 'p' was not declared in this scope
   34 |     if(d[p])
      |          ^
Language: C

#include <bits/stdc++.h>
using namespace std;
double (int,int);
int n,m,elevation;
int main(){
  cin>> n >> m;
  //elevation//
  vector<int>v= {a1,a2,a3,a4,....,an};
  for(i=0;i<=an;++i){
  cin>>elevation;
  }
for(i=1;i<=n;++i){
  cin>> a >>" ">> b;
  //take the input//
}
if(a=max(v)){
  cout<<v<<endl;
}
}

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

/* C - Peaks */

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

int main(void){
  int N, M, H[10000], A[10000], B[10000], road[10000][10000], peak = 0, i, j, count = 0;
  scanf("%d %d", &N, &M);
  /*
  H = (int*)malloc(sizeof(int) * N);
  A = (int*)malloc(sizeof(int) * M);
  B = (int*)malloc(sizeof(int) * M);
  road = (int**)malloc(sizeof(int*) * N);
  for(i = 0; i < N; i++){
    road[i] = (int*)malloc(sizeof(int) * N);
  }
  */
  for(i = 0; i < N; i++){
    scanf("%d", &H[i]);
  }
  for(i = 0; i < N; i++){
    for(j = 0; j < N; j++){
      road[i][j] = 0;
    }
  }
  for(i = 0; i < M; i++){
    scanf("%d %d", &A, &B);
    road[A][B] += 1;
    road[B][A] += 1;
  }
  /*
  for(i = 0; i < N; i++){
    for(j = 0; j < N; j++){
      printf("%d", road[i][j]);
      if(j < N - 1){
        printf(" ");
      }else{
        printf("\n");
      }
    }
  }
  */
  for(i = 0; i < N; i++){
    count = 0;
    for(j = 0; j < N; j++){
      if(road[i][j] > 0 && H[i] <= H[j]){
        count++;
        break;
      }
    }
    if(count == 0){
      peak++;
    }
  }
  printf("%d\n", peak);
}


Compiler output:
main.c: In function 'main':
main.c:28:9: error: array subscript is not an integer
   28 |     road[A][B] += 1;
      |         ^
main.c:29:9: error: array subscript is not an integer
   29 |     road[B][A] += 1;
      |         ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
long long N,M;
cin>>N>>M;
long long a[N];
long long d[N];
long long b,c,counter=0;
for(long long i=0;i<N;i++){
cin>>a[i];}
for(long long i=0;i<M;i++){
cin>>b>>c;
if(a[b]>a[c])
{d[c]=0}
else{
d[b]=0}}
for(long long i=0;i<N;i++){
if(d[i]==0)
{counter++;}}
cout<<counter<<endl;}




Compiler output:
a.cc: In function 'int main()':
a.cc:14:8: error: expected ';' before '}' token
   14 | {d[c]=0}
      |        ^
      |        ;
a.cc:16:7: error: expected ';' before '}' token
   16 | d[b]=0}}
      |       ^
      |       ;
Language: C

#include <iostream>

using namespace std;

typedef long long ll;

int main()
{
    int n, m;
    ll h[110000];
    bool a[110000];
    cin >> n >> m;

    for (int i = 0; i < n; i++)
    {
        cin >> h[i];
        a[i] = true;
    }
    for (int i = 0; i < m; i++)
    {
        int r, s;
        cin >> r >> s;
        if (h[r-1] <= h[s-1])
        {
            a[r-1] = false;
        }
        if (h[s-1] <= h[r-1])
        {
            a[s-1] = false;
        }
    }
    int s = 0;
    for (int i = 0; i < n; i++)
    {
        s += a[i];
    }
    cout << s << endl;
    return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
int h[100002],n,res,m;
bool kt[100002];
int main() {
    ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
    scanf("%d %d",&n,&m);
    res=n;
    for(int i=1;i<=n;++i) scanf("%d",&h[i]);
    for(int i=0;i<m;++i){
        int q,r;
        scanf("%d %d",&q,&r);
        if(h[q]>h[r]&&!kt[r]){res--; kt[r]=1;}
        if(h[q]<h[r]&&!kt[q]){res--; kt[q]=1;}
        if(h[q]==h[r]){
            if(!kt[q]){res--; kq[q]=1;}
            if(!kt[r]){res--; kq[r]=1;}
        }
    }
    printf("%d",res);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:31: error: 'kq' was not declared in this scope; did you mean 'q'?
   16 |             if(!kt[q]){res--; kq[q]=1;}
      |                               ^~
      |                               q
a.cc:17:31: error: 'kq' was not declared in this scope; did you mean 'q'?
   17 |             if(!kt[r]){res--; kq[r]=1;}
      |                               ^~
      |                               q
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
typedeg long long ll;
#define N 100010
ll n,m,h[N],ma[N];
//ma[i]计算的是i有连接的点的最大值 
int main(){
	cin>>n>>m;
	for(ll i=1;i<=n;i++) cin>>h[i];
	for(ll i=1;i<=m;i++){
		ll x,y;
		cin>>x>>y;
		ma[x]=max(ma[x],h[y]);
		ma[y]=max(ma[y],h[x]);
	}
	ll ans=0;
	for(ll i=1;i<=n;i++){
		ans+=h[i]>ma[i];
	}
	cout<<ans<<endl;
	return 0;
}


Compiler output:
a.cc:4:1: error: 'typedeg' does not name a type; did you mean 'typedef'?
    4 | typedeg long long ll;
      | ^~~~~~~
      | typedef
a.cc:6:1: error: 'll' does not name a type
    6 | ll n,m,h[N],ma[N];
      | ^~
a.cc: In function 'int main()':
a.cc:9:14: error: 'n' was not declared in this scope
    9 |         cin>>n>>m;
      |              ^
a.cc:9:17: error: 'm' was not declared in this scope; did you mean 'tm'?
    9 |         cin>>n>>m;
      |                 ^
      |                 tm
a.cc:10:13: error: 'll' was not declared in this scope
   10 |         for(ll i=1;i<=n;i++) cin>>h[i];
      |             ^~
a.cc:10:20: error: 'i' was not declared in this scope
   10 |         for(ll i=1;i<=n;i++) cin>>h[i];
      |                    ^
a.cc:10:35: error: 'h' was not declared in this scope
   10 |         for(ll i=1;i<=n;i++) cin>>h[i];
      |                                   ^
a.cc:11:13: error: 'll' was not declared in this scope
   11 |         for(ll i=1;i<=m;i++){
      |             ^~
a.cc:11:20: error: 'i' was not declared in this scope
   11 |         for(ll i=1;i<=m;i++){
      |                    ^
a.cc:12:19: error: expected ';' before 'x'
   12 |                 ll x,y;
      |                   ^~
      |                   ;
a.cc:13:22: error: 'x' was not declared in this scope
   13 |                 cin>>x>>y;
      |                      ^
a.cc:13:25: error: 'y' was not declared in this scope
   13 |                 cin>>x>>y;
      |                         ^
a.cc:14:17: error: 'ma' was not declared in this scope
   14 |                 ma[x]=max(ma[x],h[y]);
      |                 ^~
a.cc:14:33: error: 'h' was not declared in this scope
   14 |                 ma[x]=max(ma[x],h[y]);
      |                                 ^
a.cc:17:9: error: 'll' was not declared in this scope
   17 |         ll ans=0;
      |         ^~
a.cc:18:15: error: expected ';' before 'i'
   18 |         for(ll i=1;i<=n;i++){
      |               ^~
      |               ;
a.cc:18:20: error: 'i' was not declared in this scope
   18 |         for(ll i=1;i<=n;i++){
      |                    ^
a.cc:19:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   19 |                 ans+=h[i]>ma[i];
      |                 ^~~
      |                 abs
a.cc:19:22: error: 'h' was not declared in this scope
   19 |                 ans+=h[i]>ma[i];
      |                      ^
a.cc:19:27: error: 'ma' was not declared in this scope
   19 |                 ans+=h[i]>ma[i];
      |                           ^~
a.cc:21:15: error: 'ans' was not declared in this scope; did you mean 'abs'?
   21 |         cout<<ans<<endl;
      |               ^~~
      |               abs
Language: C++

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

int main() {
	int n,m,h,a,b,ans=0;
	cin>>n>>m;
	vector<int> height(n+1);
	for(int i=1;i<=n;i++){
		cin>>h;
		height.at(i)=h;
	}
	vector<int> top(n+1);
	for(int i=0;i<m;i++){
		cin>>a>>b;
		if(height[a]>height[b]){
			top[b]--;
		}else if(height[a]<height[b]){
			top[a]--;
		}else{
			top[a]--;
			top[b]--;
		}
	}
	for(int i=1;i<=n;i++){
		if(top[i]==0){
			ans++;
		}
	}
	cout<<ans<<endl;
	return ０;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:16: error: '\U0000ff10' was not declared in this scope
   30 |         return ０;
      |                ^~
Language: C++

#include<iostream>
 #include<algorithm>
 using namespace std;
 #define N 100010
 int main(){
 int n,m,h[N],ma[N];
 cin>>n>>m;
 for(int i=1;i<=n;i++){
 cin>>h[i];
 ma[i]=0;
 }
 for(int i=0;i<m;i++){
 int a,b;
 cin>>a>>b;
 ma[a]=max(ma[a],h[b]);
 ma[b]=max(ma[b],h[a]);
 }
 int ans=0;
 for(int i=1;i<=n;i++){
 ans+=h[i]>ma[i];
  cout<<ans<<endl;
 }

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

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

int main(){
  int n,m;
  cin >> n,m;
  vector<uint64_t> h(m);
  for(auto &it :h){
    cin >> it;
  }
  
  set<int> good;
  for(int i=0; i<n;i++){
    good.insert(i);
  }
  
  for(int i=0; i<m;i++){
    int a,b;
    a--; b--;
    if(h.at(a) == h.at(b)){
      good.erase(a);
      good.erase(b);
    }
    if(h.at(a)<h.at(b) )
      good.erase(a);
    if((h.at(b)<h.at(a) )
      good.erase(b);
  }
       cout << good.size() <<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:26: error: expected ';' before 'good'
   26 |     if((h.at(b)<h.at(a) )
      |                          ^
      |                          ;
   27 |       good.erase(b);
      |       ~~~~                
a.cc:28:3: error: expected primary-expression before '}' token
   28 |   }
      |   ^
a.cc:27:21: error: expected ')' before '}' token
   27 |       good.erase(b);
      |                     ^
      |                     )
   28 |   }
      |   ~                  
a.cc:26:7: note: to match this '('
   26 |     if((h.at(b)<h.at(a) )
      |       ^
a.cc:28:3: error: expected primary-expression before '}' token
   28 |   }
      |   ^
Language: C++

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

int main(){
  int count =0;
  int n,m;
  cin >> n >> m;
  
  vector<uint64_t> h(n);
  for(auto &it: h){
    cin >> it;
  }
  
  vector<vector<int>> v(n);
  for(int i=0;i<m;i++){
    int a,b;
    cin >> a>>b;
    a--; b--;
    v.at(a).push_back(b);
    v.at(b).push_back(a);
  }
  
  for(int i=0; i<n;i++){
    bool good;
    for(int j=0; j<v.at(i).size(); j++){
      if(h.at(i)<=h.at( v.at(i).at(j) ) 
         good = false;
    }
    if(good)  count ++;
  }
         cout << count <<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:40: error: expected ';' before 'good'
   26 |       if(h.at(i)<=h.at( v.at(i).at(j) )
      |                                        ^
      |                                        ;
   27 |          good = false;
      |          ~~~~                           
a.cc:28:5: error: expected primary-expression before '}' token
   28 |     }
      |     ^
a.cc:27:23: error: expected ')' before '}' token
   27 |          good = false;
      |                       ^
      |                       )
   28 |     }
      |     ~                  
a.cc:26:9: note: to match this '('
   26 |       if(h.at(i)<=h.at( v.at(i).at(j) )
      |         ^
a.cc:28:5: error: expected primary-expression before '}' token
   28 |     }
      |     ^
Language: C++

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

int main(){
  int count =0;
  int n,m;
  cin >> n >> m;
  
  vector<uint64_t> h(n);
  for(auto &it: h){
    cin >> it;
  }
  
  vector<vector<int>> v(n);
  for(int i=0;i<m;i++){
    int a,b;
    cin >> a>>b;
    a--; b--;
    v.at(a).push_back(b);
    v.at(b).push_back(a);
  }
  
  for(int i=0; i<n;i++){
    bool good;
    for(int j=0; j<v.at(i).size(); j++){
      if(h.at(i)<=h.at( v.at(i).at(j) ) 
         j = false;
    }
    if(good)  count ++;
  }
         cout << count <<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:40: error: expected ';' before 'j'
   26 |       if(h.at(i)<=h.at( v.at(i).at(j) )
      |                                        ^
      |                                        ;
   27 |          j = false;
      |          ~                              
a.cc:28:5: error: expected primary-expression before '}' token
   28 |     }
      |     ^
a.cc:27:20: error: expected ')' before '}' token
   27 |          j = false;
      |                    ^
      |                    )
   28 |     }
      |     ~               
a.cc:26:9: note: to match this '('
   26 |       if(h.at(i)<=h.at( v.at(i).at(j) )
      |         ^
a.cc:28:5: error: expected primary-expression before '}' token
   28 |     }
      |     ^
Language: C

#include"bits/stdc++.h"
using namespace std;
#define ll long long
#define LL long long
#define MOD 1000000007
#define INF 2000000000000
int dx[4] = { 0,1,0,-1 };
int dy[4] = { 1,0,-1,0 };
ll N, M, K, H, W, L, R, l, r, u, sum, Q;
LL ans=0;
LL no;

string s, t;

LL gcd(int p, int q) {
	if (p % q == 0)return q;
	return gcd(q, p % q);

}


int main() {
	cin >> N >> M;
	
	vector<LL> h(N + 1),v(N + 1),a(M),b(M);
	for (int i = 1; i <= N; i++) {
		cin >> h[i];
		v[i] = -1;
	}
	for (int i = 0; i < M; i++) {
		cin >> a[i] >> b[i];
		v[a[i]] = max(v[a[i]], h[b[i]]);
		v[b[i]] = max(v[b[i]], h[a[i]]);
	}
	
	for (int i = 1; i <= N; i++) {
		if (v[i] < h[i])ans++;
	}

	cout << ans<<endl;
	return 0;
}



Compiler output:
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
    1 | #include"bits/stdc++.h"
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
using namespace std;
//型に気を付けよう

#define rep(i,n) for(int i=0;i<n;i++)
typedef long long  ll;
typedef long double  ld;
typedef pair<int,int> pairii;
const double pi=3.1415926535;
const ll  mod=1000000007;
//桁数指定　cout << fixed << setprecision(2)
int main(){
  int N=100009
 int n,m,h[N],ma[N];
 cin>>n>>m;
 for(int i=1;i<=n;i++){
 cin>>h[i];
 ma[i]=0;
 }
 for(int i=0;i<m;i++){
 int a,b;
 cin>>a>>b;
 ma[a]=max(ma[a],h[b]);
 ma[b]=max(ma[b],h[a]);
 }
 int ans=0;
 for(int i=1;i<=n;i++){
 ans+=(h[i]>ma[i]);
 }
 cout<<ans<<endl;
 }


Compiler output:
a.cc: In function 'int main()':
a.cc:14:2: error: expected ',' or ';' before 'int'
   14 |  int n,m,h[N],ma[N];
      |  ^~~
a.cc:15:7: error: 'n' was not declared in this scope
   15 |  cin>>n>>m;
      |       ^
a.cc:15:10: error: 'm' was not declared in this scope
   15 |  cin>>n>>m;
      |          ^
a.cc:17:7: error: 'h' was not declared in this scope
   17 |  cin>>h[i];
      |       ^
a.cc:18:2: error: 'ma' was not declared in this scope; did you mean 'fma'?
   18 |  ma[i]=0;
      |  ^~
      |  fma
a.cc:23:2: error: 'ma' was not declared in this scope; did you mean 'a'?
   23 |  ma[a]=max(ma[a],h[b]);
      |  ^~
      |  a
a.cc:23:18: error: 'h' was not declared in this scope
   23 |  ma[a]=max(ma[a],h[b]);
      |                  ^
a.cc:28:8: error: 'h' was not declared in this scope
   28 |  ans+=(h[i]>ma[i]);
      |        ^
a.cc:28:13: error: 'ma' was not declared in this scope; did you mean 'fma'?
   28 |  ans+=(h[i]>ma[i]);
      |             ^~
      |             fma
Language: C++

#include <bits/stdc++.h>
using namespace std;
//型に気を付けよう

#define rep(i,n) for(int i=0;i<n;i++)
typedef long long  ll;
typedef long double  ld;
typedef pair<int,int> pairii;
const double pi=3.1415926535;
const ll  mod=1000000007;
//桁数指定　cout << fixed << setprecision(2)
int main(){
 int n,m,h[N],ma[N];
 cin>>n>>m;
 for(int i=1;i<=n;i++){
 cin>>h[i];
 ma[i]=0;
 }
 for(int i=0;i<m;i++){
 int a,b;
 cin>>a>>b;
 ma[a]=max(ma[a],h[b]);
 ma[b]=max(ma[b],h[a]);
 }
 int ans=0;
 for(int i=1;i<=n;i++){
 ans+=(h[i]>ma[i]);
 }
 cout<<ans<<endl;
 }


Compiler output:
a.cc: In function 'int main()':
a.cc:13:12: error: 'N' was not declared in this scope
   13 |  int n,m,h[N],ma[N];
      |            ^
a.cc:16:7: error: 'h' was not declared in this scope
   16 |  cin>>h[i];
      |       ^
a.cc:17:2: error: 'ma' was not declared in this scope; did you mean 'm'?
   17 |  ma[i]=0;
      |  ^~
      |  m
a.cc:22:2: error: 'ma' was not declared in this scope; did you mean 'a'?
   22 |  ma[a]=max(ma[a],h[b]);
      |  ^~
      |  a
a.cc:22:18: error: 'h' was not declared in this scope
   22 |  ma[a]=max(ma[a],h[b]);
      |                  ^
a.cc:27:8: error: 'h' was not declared in this scope
   27 |  ans+=(h[i]>ma[i]);
      |        ^
a.cc:27:13: error: 'ma' was not declared in this scope; did you mean 'm'?
   27 |  ans+=(h[i]>ma[i]);
      |             ^~
      |             m
Language: C++

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

ll i,j;

vector<int> G(100010);

int main(){
    int n,m;cin>>n>>m;
    vector<ll> h(n);
    for(i=0;i<n;i++){
        cin>>h[i];
    }

    for(i=0;i<m;i++){
        int a,b;
        cin>>a>>b;
        a--;b--;
        G[a].push_back(b);
        G[b].push_back(a);
    }

    int ans=0;
    for(i=0;i<n;i++){
        bool ok=true;
        for(j=0;j<G[i].size();j++){
            if(h[i]<=h[G[i][j]]){
                ok=false;
            }
        }
        if(ok){ans++;}
    }

    cout<<ans<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:14: error: request for member 'push_back' in 'G.std::vector<int>::operator[](((std::vector<int>::size_type)a))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   21 |         G[a].push_back(b);
      |              ^~~~~~~~~
a.cc:22:14: error: request for member 'push_back' in 'G.std::vector<int>::operator[](((std::vector<int>::size_type)b))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   22 |         G[b].push_back(a);
      |              ^~~~~~~~~
a.cc:28:24: error: request for member 'size' in 'G.std::vector<int>::operator[](((std::vector<int>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   28 |         for(j=0;j<G[i].size();j++){
      |                        ^~~~
a.cc:29:28: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}[long long int]' for array subscript
   29 |             if(h[i]<=h[G[i][j]]){
      |                            ^
Language: C++

#値の入力
n,m = map(int,input().split())
h = list(map(int, input().split()))
obs = []
j = []
for i in range(m):
    a, b = list(map(int, input().split()))
    j.append([a,b])

for i in j:
    if h[i[0]-1] > h[i[1]-1]:
        obs.append(h[i[0]-1]) 
    elif h[i[1]-1] > h[i[0]-1]:
        obs.append(h[i[1]-1])
print(obs) 
print(len(set(obs)))

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #\U00005024\U0000306e\U00005165\U0000529b
    1 | #値の入力
      |  ^~~~~~~~
a.cc:2:1: error: 'n' does not name a type
    2 | n,m = map(int,input().split())
      | ^
Language: C++

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

ll i,k;

vector<int> list[100010];

int main(){
    int n,m;cin>>n>>m;
    vector<ll> h(n);
    for(i=0;i<n;i++){
        cin>>h[i];
    }

    for(i=0;i<m;i++){
        int a,b;
        a--;b--;
        list[a].push_back(b);
        list[b].push_back(a);
    }

    int ans=0;
    for(i=0;i<n;i++){
        bool ok=true;
        for(auto next:list[i]){
            if(h[i]<=h[next]){
                ok=false;
            }
        }
        if(ok){ans++;}
    }

    cout<<ans<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:9: error: reference to 'list' is ambiguous
   20 |         list[a].push_back(b);
      |         ^~~~
In file included from /usr/include/c++/14/list:65,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:150,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_list.h:633:11: note: candidates are: 'template<class _Tp, class _Alloc> class std::__cxx11::list'
  633 |     class list : protected _List_base<_Tp, _Alloc>
      |           ^~~~
a.cc:8:13: note:                 'std::vector<int> list [100010]'
    8 | vector<int> list[100010];
      |             ^~~~
a.cc:21:9: error: reference to 'list' is ambiguous
   21 |         list[b].push_back(a);
      |         ^~~~
/usr/include/c++/14/bits/stl_list.h:633:11: note: candidates are: 'template<class _Tp, class _Alloc> class std::__cxx11::list'
  633 |     class list : protected _List_base<_Tp, _Alloc>
      |           ^~~~
a.cc:8:13: note:                 'std::vector<int> list [100010]'
    8 | vector<int> list[100010];
      |             ^~~~
a.cc:27:23: error: reference to 'list' is ambiguous
   27 |         for(auto next:list[i]){
      |                       ^~~~
/usr/include/c++/14/bits/stl_list.h:633:11: note: candidates are: 'template<class _Tp, class _Alloc> class std::__cxx11::list'
  633 |     class list : protected _List_base<_Tp, _Alloc>
      |           ^~~~
a.cc:8:13: note:                 'std::vector<int> list [100010]'
    8 | vector<int> list[100010];
      |             ^~~~
Language: C

#include<stdio.h>
int main(void)
{
	int n,m,cnt=0;
	scanf("%d %d",&n,&m);
	long int h[n+1];
	int a,b,d[10001]={0};
	for(int i=1;i<=n;i++){
		scanf("%d",&h[i]);
	}
	for(int i=1;i<=m;i++){
		scanf("%d %d",&a,&b);
		if(h[a]<h[b]){
			d[a]=1;
		}
		else if(h[b]<h[a] { d[b]=1;}
		else {
			d[a]=1;
			d[b]=1;
		}
	}
	for(int i=1;i<=n;i++) {
		if(d[i]==0)
			cnt++;
	}
	printf("%d\n",cnt);
	return 0;
}
		
	
	

Compiler output:
main.c: In function 'main':
main.c:16:34: error: expected ')' before '{' token
   16 |                 else if(h[b]<h[a] { d[b]=1;}
      |                        ~         ^~
      |                                  )
main.c:21:9: error: expected expression before '}' token
   21 |         }
      |         ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int N = 100010;
 
int main() {
  int n, m, h[N], ma[N];
  cin >> n >> m;
  for(int i = 1; i <= n; i++){
    cin >> h[i];
    ma[i] = 0;
  }
  for(int i = 0; i < m; i++){
    int a, b;
    cin >> a >> b;
    ma[a] = max(ma[a], h[b]);
    ma[b] = max(ma[b], h[a]);
  }
  int ans = 0;
  for(int i = 1; i <= n; i++){
    ans+=h[i]>ma[i];
  }
  cout << ans << endl;
}
#include <bits/stdc++.h>
using namespace std;
int N = 100010;

int main() {
  int n, m, h[N], ma[N};
  cin >> n >> m;
  for(int i = 1; i <= n; i++){
    cin >> h[i];
    ma[i] = 0;
  }
  for(int i = 0; i < m; i++){
    int a, b;
    cin >> a >> b;
    ma[a] = max(ma[a], h[b]);
    ma[b] = max(ma[b], h[a]);
  }
  int ans = 0;
  for(int i = 1; i <= n; i++){
    ans+=h[i]>ma[i];
  }
  cout << ans << endl;
}


Compiler output:
a.cc:26:5: error: redefinition of 'int N'
   26 | int N = 100010;
      |     ^
a.cc:3:5: note: 'int N' previously defined here
    3 | int N = 100010;
      |     ^
a.cc:28:5: error: redefinition of 'int main()'
   28 | int main() {
      |     ^~~~
a.cc:5:5: note: 'int main()' previously defined here
    5 | int main() {
      |     ^~~~
a.cc: In function 'int main()':
a.cc:29:23: error: expected ']' before '}' token
   29 |   int n, m, h[N], ma[N};
      |                       ^
      |                       ]
a.cc: At global scope:
a.cc:30:3: error: 'cin' does not name a type
   30 |   cin >> n >> m;
      |   ^~~
a.cc:31:3: error: expected unqualified-id before 'for'
   31 |   for(int i = 1; i <= n; i++){
      |   ^~~
a.cc:31:18: error: 'i' does not name a type
   31 |   for(int i = 1; i <= n; i++){
      |                  ^
a.cc:31:26: error: 'i' does not name a type
   31 |   for(int i = 1; i <= n; i++){
      |                          ^
a.cc:35:3: error: expected unqualified-id before 'for'
   35 |   for(int i = 0; i < m; i++){
      |   ^~~
a.cc:35:18: error: 'i' does not name a type
   35 |   for(int i = 0; i < m; i++){
      |                  ^
a.cc:35:25: error: 'i' does not name a type
   35 |   for(int i = 0; i < m; i++){
      |                         ^
a.cc:42:3: error: expected unqualified-id before 'for'
   42 |   for(int i = 1; i <= n; i++){
      |   ^~~
a.cc:42:18: error: 'i' does not name a type
   42 |   for(int i = 1; i <= n; i++){
      |                  ^
a.cc:42:26: error: 'i' does not name a type
   42 |   for(int i = 1; i <= n; i++){
      |                          ^
a.cc:45:3: error: 'cout' does not name a type
   45 |   cout << ans << endl;
      |   ^~~~
a.cc:46:1: error: expected declaration before '}' token
   46 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int N = 100010;

int main() {
  int n, m, h[N], ma[N};
  cin >> n >> m;
  for(int i = 1; i <= n; i++){
    cin >> h[i];
    ma[i] = 0;
  }
  for(int i = 0; i < m; i++){
    int a, b;
    cin >> a >> b;
    ma[a] = max(ma[a], h[b]);
    ma[b] = max(ma[b], h[a]);
  }
  int ans = 0;
  for(int i = 1; i <= n; i++){
    ans+=h[i]>ma[i];
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:23: error: expected ']' before '}' token
    6 |   int n, m, h[N], ma[N};
      |                       ^
      |                       ]
a.cc: At global scope:
a.cc:7:3: error: 'cin' does not name a type
    7 |   cin >> n >> m;
      |   ^~~
a.cc:8:3: error: expected unqualified-id before 'for'
    8 |   for(int i = 1; i <= n; i++){
      |   ^~~
a.cc:8:18: error: 'i' does not name a type
    8 |   for(int i = 1; i <= n; i++){
      |                  ^
a.cc:8:26: error: 'i' does not name a type
    8 |   for(int i = 1; i <= n; i++){
      |                          ^
a.cc:12:3: error: expected unqualified-id before 'for'
   12 |   for(int i = 0; i < m; i++){
      |   ^~~
a.cc:12:18: error: 'i' does not name a type
   12 |   for(int i = 0; i < m; i++){
      |                  ^
a.cc:12:25: error: 'i' does not name a type
   12 |   for(int i = 0; i < m; i++){
      |                         ^
a.cc:19:3: error: expected unqualified-id before 'for'
   19 |   for(int i = 1; i <= n; i++){
      |   ^~~
a.cc:19:18: error: 'i' does not name a type
   19 |   for(int i = 1; i <= n; i++){
      |                  ^
a.cc:19:26: error: 'i' does not name a type
   19 |   for(int i = 1; i <= n; i++){
      |                          ^
a.cc:22:3: error: 'cout' does not name a type
   22 |   cout << ans << endl;
      |   ^~~~
a.cc:23:1: error: expected declaration before '}' token
   23 | }
      | ^
Language: C

#include <iostream>
#include <map>
#include <vector>
using namespace std;
int main()
{
    long int N,M,x,y,good=0;
    cin >> N >> M;
    map<int,map<int,int> > MAP;
    long long int H;
    vector<long long int> height;
    height.push_back(0);
    for(int i=1; i<=N; i++)
    {
        cin >> H;
        height.push_back(H);
    }
    for(int i=1;i<=M;i++)
    {
        cin >> x >> y;
        MAP[x][y]++;
        MAP[y][x]++;
    }
    for(int i=1; i<=N; i++)
    {
        bool great=true,singlepath=false; 
        if((MAP[i].size())==0)
        {
            continue;
        }       
        for (auto it1=MAP[i].begin(); it1!=MAP[i].end(); it1++)
        {
            if( height[i] < height[it1->first] )
            {
                great=false;
            }  
            if(MAP[i][it1->first]==1)
            {
                singlepath=true;
            }
        }
        if((great&&singlepath) || (great && (!singlepath)) )
        {
            good++;
        }
    }
    cout << good;

    return 0;
}


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

/**
*    created: 04.05.2020 02:49:20
**/

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
#define rep(i,n) for(int i=0;i<(int)(n);i++)

int main() {
    int n;
    cin >> n;
    ll a[n];
    rep(i, n) cin >> a[i];
    int x = 0;
    map<ll,int> m;
    rep(i,n){
        x += m[i-a[i];
        m[i+a[i]]++;
    }

    cout << x << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:22: error: expected ']' before ';' token
   18 |         x += m[i-a[i];
      |                      ^
      |                      ]