Language: C++

#include<bits/stdc++.h>
int main(){
  int N,M;
  std::cin >> N >> M;
  std::vector<int>H(N);
  for(auto& e : H) std::cin >> e;
  std::vector<std::vector<int>>edge(N);
  for(int i = 0; i < M; ++i){
    int s,t; std::cin >> s  >> t;
    --s;--t;
    edge[s].emplace_back(t);
    edge[t].emplace_back(s);
  }
  int ans = 0;
  int v = 0;
  for(auto& v :edge){
    auto itr = std::max_element(v.begin(),v.end());
    if(*itr < H[v]) ++ans;
    ++v;
  }#include<bits/stdc++.h>
int main(){
  int N,M;
  std::cin >> N >> M;
  std::vector<int>H(N);
  for(auto& e : H) std::cin >> e;
  std::vector<std::vector<int>>edge(N);
  for(int i = 0; i < M; ++i){
    int s,t; std::cin >> s  >> t;
    --s;--t;
    edge[s].emplace_back(t);
    edge[t].emplace_back(s);
  }
  int ans = 0;
  int cv = 0;
  for(auto& v :edge){
    auto itr = std::max_element(v.begin(),v.end());
    if(*itr < H[cv]) ++ans;
    ++cv;
  }
  std::cout << ans << std::endl;
}

  std::cout << ans << std::endl;
}


Compiler output:
a.cc:20:4: error: stray '#' in program
   20 |   }#include<bits/stdc++.h>
      |    ^
a.cc: In function 'int main()':
a.cc:18:16: error: no match for 'operator[]' (operand types are 'std::vector<int>' and 'std::vector<int>')
   18 |     if(*itr < H[v]) ++ans;
      |                ^
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:1128:7: note: candidate: 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = int; _Alloc = std::allocator<int>; reference = int&; size_type = long unsigned int]'
 1128 |       operator[](size_type __n) _GLIBCXX_NOEXCEPT
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1128:28: note:   no known conversion for argument 1 from 'std::vector<int>' to 'std::vector<int>::size_type' {aka 'long unsigned int'}
 1128 |       operator[](size_type __n) _GLIBCXX_NOEXCEPT
      |                  ~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1147:7: note: candidate: 'std::vector<_Tp, _Alloc>::const_reference std::vector<_Tp, _Alloc>::operator[](size_type) const [with _Tp = int; _Alloc = std::allocator<int>; const_reference = const int&; size_type = long unsigned int]'
 1147 |       operator[](size_type __n) const _GLIBCXX_NOEXCEPT
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1147:28: note:   no known conversion for argument 1 from 'std::vector<int>' to 'std::vector<int>::size_type' {aka 'long unsigned int'}
 1147 |       operator[](size_type __n) const _GLIBCXX_NOEXCEPT
      |                  ~~~~~~~~~~^~~
a.cc:19:5: error: no match for 'operator++' (operand type is 'std::vector<int>')
   19 |     ++v;
      |     ^~~
a.cc:20:5: error: 'include' was not declared in this scope
   20 |   }#include<bits/stdc++.h>
      |     ^~~~~~~
a.cc:20:13: error: 'bits' was not declared in this scope
   20 |   }#include<bits/stdc++.h>
      |             ^~~~
a.cc:20:18: error: 'stdc' was not declared in this scope; did you mean 'std'?
   20 |   }#include<bits/stdc++.h>
      |                  ^~~~
      |                  std
a.cc:21:1: error: expected primary-expression before 'int'
   21 | int main(){
      | ^~~