Language: C++

#include<bits/stdc++.h>
typedef long long ll;
typedef vector<int> vi;
typedef vector<string> vs;
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define rep(i,n) FOR(i,0,n)
#define pb push_back
#define all(a) (a).begin(),(a).end()
#define UNIQUE(v) v.erase(unique(all(v)),v.end());
#define fill(a,x) memset(a,x,sizeof(a))
#define zero(a) fill(a,0)
#define minus(a) fill(a,-1)
#define dbg(x) cout << #x"=" << x << endl

int main() {
  vi array;
  ll n;
  ll k;
  ll l;
  int count = 0;
  int t = 0;
  cin >> n;
  cin >> k;
  while(count < n){
    cin >> l;
    array.pb(l);
    count++;
  }
  sort(all(array));

  while (t < k) {
    array.pop_back();
    t++;
    if(t >= n) break;
  }

  ll sum=0;
  rep(i, n-k) sum += array[i];
  cout << sum << endl;
  return 0;

}


Compiler output:
a.cc:3:9: error: 'vector' does not name a type
    3 | typedef vector<int> vi;
      |         ^~~~~~
a.cc:4:9: error: 'vector' does not name a type
    4 | typedef vector<string> vs;
      |         ^~~~~~
a.cc: In function 'int main()':
a.cc:16:3: error: 'vi' was not declared in this scope
   16 |   vi array;
      |   ^~
a.cc:22:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   22 |   cin >> n;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:26:5: error: 'array' was not declared in this scope; did you mean 'std::array'?
   26 |     array.pb(l);
      |     ^~~~~
      |     std::array
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_pair.h:99:12: note: 'std::array' declared here
   99 |     struct array;
      |            ^~~~~
a.cc:29:12: error: 'array' was not declared in this scope; did you mean 'std::array'?
   29 |   sort(all(array));
      |            ^~~~~
a.cc:8:17: note: in definition of macro 'all'
    8 | #define all(a) (a).begin(),(a).end()
      |                 ^
/usr/include/c++/14/bits/stl_pair.h:99:12: note: 'std::array' declared here
   99 |     struct array;
      |            ^~~~~
a.cc:29:3: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
   29 |   sort(all(array));
      |   ^~~~
      |   std::sort
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
a.cc:39:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   39 |   cout << sum << endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:39:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   39 |   cout << sum << endl;
      |                  ^~~~
      |                  std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~