Language: C++

#include <iostream>
#include <algorithm>
#include <string>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <vector>
#include <queue>
#include <stack>
#include <cmath>
#include <map>
#include <iomanip>
#include <set>
#include <ctime>
#include <tuple>
#include <bitset>
#include <assert.h>
#include <deque>
using namespace std;

/*
using PAIR = pair<string, int>;
sort(sp.begin(), sp.end(), [](PAIR l, PAIR r){
        return l.first<r.first || (l.first==r.first && l.second > r.second);
        });
*/

typedef long long ll;

#define fi first
#define se second
#define rep(i, n) for (ll i = 0; i < n; i++)
#define debugA() cerr << "AAAAA" << endl
#define debug_() cerr << "-------------" << endl
#define debug(x) cerr << #x << ": " << x << endl
#define debug_vec(v)                   \
    for (int i = 0; i < v.size(); i++) \
    {                                  \
        cout << v[i] << " ";           \
    }                                  \
    cout << endl;
#define debug_vec2(v)                         \
    for (int i = 0; i < v.size(); i++)        \
    {                                         \
        for (int j = 0; j < v[i].size(); j++) \
        {                                     \
            cout << v[i][j] << " ";           \
        }                                     \
        cout << endl;                         \
    }

using Graph = vector<vector<int>>;
using P = pair<int, int>;
using P1 = pair<pair<int, int>, int>; // クラスカル法とかで、{cost, {from, to}}的に使う。
const int INF = 1001001001;
const double pi = acos(-1);

int main()
{
    ll n, k;
    cin >> n >> k;
    vector<ll> a(n);
    vector<ll> SUM(n + 10, 0);
    for (int i = 0; i < n; i++)
    {
        cin >> a[i];
        SUM[max(0ll, i - a[i])]++;
        SUM[min(n, i + a[i] + 1)]--;
    }
    for (int i = 0; i < n; i++)
    {
        SUM[i + 1] += SUM[i];
    }
    int rest = 0;
    for (ll i = 0; i < min(100,k-1); i++)
    {
        ll MIN = 1001001001;
        vector<ll> SUM1(n + 10, 0);
        for (ll j = 0; j < n; j++)
        {
            SUM1[max(0ll, j - SUM[j])]++;
            SUM1[min(n, j + SUM[j] + 1)]--;
        }
        for (int j = 0; j < n; j++)
        {
            SUM1[j + 1] += SUM1[j];
            MIN = min(MIN, SUM[j + 1]);
        }
        if (MIN >= n)
        {
            rest = k - 1 - i;
            break;
        }
        swap(SUM, SUM1);
    }
    for (int i = 0; i < n; i++)
    {
        SUM[i] += n * rest;
    }
    for (int i = 0; i < n; i++)
    {
        cout << SUM[i]<<" ";
    }
    cout << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:75:27: error: no matching function for call to 'min(int, ll)'
   75 |     for (ll i = 0; i < min(100,k-1); i++)
      |                        ~~~^~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 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:75:27: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
   75 |     for (ll i = 0; i < min(100,k-1); 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,
                 from a.cc:2:
/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:75:27: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   75 |     for (ll i = 0; i < min(100,k-1); i++)
      |                        ~~~^~~~~~~~~