Language: C++

//-------------
//include
//-------------
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <vector>
#include <string>
#include <cctype>
#include <random>
#include <cstdlib>
#include <iostream>
#include <numeric>
#include <algorithm>
using namespace std;
//-------------
//typedef
//-------------
typedef long long LL;
typedef  vector<int> VI;
typedef  set<int> SI;
typedef  string STR;
typedef  pair<int, int> PII;
typedef  vector<int, int> VII;
typedef  map<string, int> MSI;
//-------------
//utillty
//-------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define MK make_pair
#define PB push_back
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define COUT(a) cout<<a<<endl
//-------------
//repetition
//-------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
//-------------
//debug
//-------------
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define dumpl(c) REP(i,SZ(c))cerr<<#c<<i<<"="<<(c[i])<<endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

const int MOD = 1000000007;
int main()
{
	int N,K;
	cin >>N>>K;
	VI A;
	REP(i,N)
	{
		int temp;
		cin >> temp;
		A.push_back(temp);
	}
	SORT(A);
	COUT(accumulate(A[K-1],A.end(),0));
#ifdef _DEBUG
	while (1);
#endif // _DEBUG

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:64:24: error: no matching function for call to 'accumulate(__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&, std::vector<int>::iterator, int)'
   64 |         COUT(accumulate(A[K-1],A.end(),0));
      |              ~~~~~~~~~~^~~~~~~~~~~~~~~~~~
a.cc:38:23: note: in definition of macro 'COUT'
   38 | #define COUT(a) cout<<a<<endl
      |                       ^
In file included from /usr/include/c++/14/numeric:62,
                 from /usr/include/c++/14/bits/random.tcc:33,
                 from /usr/include/c++/14/random:50,
                 from a.cc:11:
/usr/include/c++/14/bits/stl_numeric.h:134:5: note: candidate: 'template<class _InputIterator, class _Tp> _Tp std::accumulate(_InputIterator, _InputIterator, _Tp)'
  134 |     accumulate(_InputIterator __first, _InputIterator __last, _Tp __init)
      |     ^~~~~~~~~~
/usr/include/c++/14/bits/stl_numeric.h:134:5: note:   template argument deduction/substitution failed:
a.cc:64:24: note:   deduced conflicting types for parameter '_InputIterator' ('int' and '__gnu_cxx::__normal_iterator<int*, std::vector<int> >')
   64 |         COUT(accumulate(A[K-1],A.end(),0));
      |              ~~~~~~~~~~^~~~~~~~~~~~~~~~~~
a.cc:38:23: note: in definition of macro 'COUT'
   38 | #define COUT(a) cout<<a<<endl
      |                       ^
/usr/include/c++/14/bits/stl_numeric.h:161:5: note: candidate: 'template<class _InputIterator, class _Tp, class _BinaryOperation> _Tp std::accumulate(_InputIterator, _InputIterator, _Tp, _BinaryOperation)'
  161 |     accumulate(_InputIterator __first, _InputIterator __last, _Tp __init,
      |     ^~~~~~~~~~
/usr/include/c++/14/bits/stl_numeric.h:161:5: note:   candidate expects 4 arguments, 3 provided