Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)

#define SIZE(x) ((ll)(x).size()) 
#define MAX(x) *max_element(ALL(x)) 
#define MIN(x) *min_element(ALL(x)) 
#define ALL(x) (x).begin(),(x).end() 

#define INF 1000000000000 
#define MOD 1000000007 
#define MAXR 100000 

#define PB push_back 
#define MP make_pair 
#define F first 
#define S second 



signed main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n, k;
    cin >> n >> k;
    //vector<int> a(100005);
  	vector<int> a(200005);
    REP(i, n) cin >> a[i];
    //vector<int> b(100005, 0);
  	vector<int> b(200005, 0);
    REP(_, min(k, 42LL)){
        vector<int> b(100005, 0);
        REP(i, n){
            int l = max(0, (int)i-a[i]);
            int r = min(n-1, (int)i+a[i]);
            b[l] += 1;
            b[r+1] -= 1;
        }
        REP(i, n-1) b[i+1] += b[i];
        REP(i, n) a[i] = b[i];
    }
    REP(i, n) cout << a[i] << " ";
}


Compiler output:
a.cc: In function 'int main()':
a.cc:36:15: error: no matching function for call to 'min(int&, long long int)'
   36 |     REP(_, min(k, 42LL)){
      |            ~~~^~~~~~~~~
a.cc:5:36: note: in definition of macro 'REP'
    5 | #define REP(i,n) for(ll i=0;i<(ll)(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:36:15: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   36 |     REP(_, min(k, 42LL)){
      |            ~~~^~~~~~~~~
a.cc:5:36: note: in definition of macro 'REP'
    5 | #define REP(i,n) for(ll i=0;i<(ll)(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:36:15: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   36 |     REP(_, min(k, 42LL)){
      |            ~~~^~~~~~~~~
a.cc:5:36: note: in definition of macro 'REP'
    5 | #define REP(i,n) for(ll i=0;i<(ll)(n);i++)
      |                                    ^