Language: C++

#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int64_t i = 0; i < (int64_t)(n); i++)
using vi = vector<int64_t>;
using vvi = vector<vi>;
using ll = int64_t;
using P = pair<ll,ll>;
ll INF = 1000000007;
// ll INF = 9223372036854775807;
// ll INF = 998244353;

int main() {
    // fasten cin
    cin.tie(0);
    ios::sync_with_stdio(false);
    // implement
    ll n,k;
    cin >> n >> k;
    vi a(n);
    rep(i,n) cin >> a.at(i);
    rep(i,min(k,50LL)){
        vi flg(n+1), next(n);
        vector<P> p(n);
        rep(l,n){
            flg.at(max((ll)0,l-a.at(l)))++;
            flg.at(min(n-1,l+a.at(l))+1)--;
        }
        next.at(0) = flg.at(0);
        rep(l,n-1) next.at(l+1) = flg.at(l+1) + next.at(l);
        a = next;
    }
    rep(i,n) cout << a.at(i) << " ";
    cout << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:14: error: no matching function for call to 'min(ll&, long long int)'
   22 |     rep(i,min(k,50LL)){
      |           ~~~^~~~~~~~
a.cc:4:53: note: in definition of macro 'rep'
    4 | #define rep(i, n) for (int64_t i = 0; i < (int64_t)(n); i++)
      |                                                     ^
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:22:14: note:   deduced conflicting types for parameter 'const _Tp' ('long int' and 'long long int')
   22 |     rep(i,min(k,50LL)){
      |           ~~~^~~~~~~~
a.cc:4:53: note: in definition of macro 'rep'
    4 | #define rep(i, n) for (int64_t i = 0; i < (int64_t)(n); i++)
      |                                                     ^
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:22:14: note:   mismatched types 'std::initializer_list<_Tp>' and 'long int'
   22 |     rep(i,min(k,50LL)){
      |           ~~~^~~~~~~~
a.cc:4:53: note: in definition of macro 'rep'
    4 | #define rep(i, n) for (int64_t i = 0; i < (int64_t)(n); i++)
      |                                                     ^