Language: C++

#include <algorithm>
#include <array>
#include <cassert>
#include <iostream>
#include <map>
#include <sstream>
#include <string>
#include <tuple>
#include <vector>
// #include <queue>

using namespace std;

namespace atcoder {
namespace {

////////////////////////////////////////////////////////////////
using UUU = unsigned long;
[[gnu::unused]] constexpr auto modP{1000 * 1000 * 1000 + 7};
[[gnu::unused]] UUU pow0(const UUU a, const UUU n, const UUU acc)
{
  if (a >= modP)
    return pow0(a % modP, n, acc);
  if (acc >= modP)
    return pow0(a, n, acc % modP);
  if (n == 0)
    return acc;
  if ((n & 1) == 0)
    return pow0(a * a, n / 2, acc);
  return pow0(a, n - 1, (acc * a) % modP);
}
[[gnu::unused]] UUU pow(const UUU a, const UUU n)
{
  return pow0(a, n, 1);
}
////////////////////////////////////////////////////////////////
// XXX
[[gnu::unused]] long choose(const long n, const long k)
{
  if (k == 0) return 1;
  long ans = 1;
  for (long p = n, q = 1; q <= k; --p, ++q) {
    ans *= p;
    ans /= q; // this always divides
    ans %= modP;
  }
  return ans;
}


////////////////////////////////////////////////////////////////
template<typename T>
[[gnu::unused]] vector<T> getNseqN(istream& in)
{
  size_t N;
  in >> N;
  vector<T> seq;
  for (auto i = 0u; i < N; ++i) {
    T x;
    in >> x;
    seq.push_back(x);
  }
  return seq;
}

template<typename T>
[[gnu::unused]] vector<T> getSeq(istream& in)
{
  vector<T> seq;
  while (true) {
    T x;
    in >> x;
    if (in.eof()) break;
    seq.push_back(x);
  }
  return seq;
}

[[gnu::unused]] long solve(istream& in)
{
  auto input = getNseqN<long>(in);
  return count(input);
}

long solve1(const long N, const long K, const long i)
{
  const auto p1 = choose(K - 1, i - 1);
  const auto p2 = choose(N - K - i + 1 + i, i);
  // cout << N << "," << K << "," << i << ": => " << p1 << ',' << p2 << '\n';
  return p1 * p2;
}

[[gnu::unused]] vector<unsigned long> solveV(istream& in)
{
  unsigned long N, K;
  in >> N >> K;
  assert(1 <= K && K <= N && N <= 2000);

  vector<unsigned long> ans(K);
  for (auto i = 0u; i < K; ++i) {
    ans[i] = solve1(N, K, i + 1);
  }
  return ans;
}

[[gnu::unused]] void testV()
{
  {
    constexpr auto inStr = R"(
5 3
)";
    constexpr auto outStr = R"(
3
6
1
)";
    stringstream in{inStr};
    stringstream out{outStr};
    const auto outs = getSeq<long>(out);
    const auto ans = solveV(in);
    assert(outs.size() == ans.size());
    const auto K = outs.size();
    for (auto i = 0u; i < K; ++i) {
      assert(outs[i] == ans[i]);
    }
  }
  {
    constexpr auto inStr = R"(
2000 3
)";
    constexpr auto outStr = R"(
1998
3990006
327341989
)";
    stringstream in{inStr};
    stringstream out{outStr};
    const auto outs = getSeq<long>(out);
    const auto ans = solveV(in);
    assert(outs.size() == ans.size());
    const auto K = outs.size();
    for (auto i = 0u; i < K; ++i) {
      assert(outs[i] == ans[i]);
    }
  }
}

} // namespace
} // namespace atcoder

////////////////////////////////////////////////////////////////
int main()
{
  using namespace atcoder;
  // testV();
  cout << solve(cin);
}


Compiler output:
a.cc: In function 'long int atcoder::{anonymous}::solve(std::istream&)':
a.cc:82:15: error: no matching function for call to 'count(std::vector<long int, std::allocator<long int> >&)'
   82 |   return count(input);
      |          ~~~~~^~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:4025:5: note: candidate: 'template<class _IIter, class _Tp> typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)'
 4025 |     count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
      |     ^~~~~
/usr/include/c++/14/bits/stl_algo.h:4025:5: note:   candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, typename std::iterator_traits<_II>::difference_type> std::count(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)'
  101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
      | ^~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note:   candidate expects 4 arguments, 1 provided