Language: C++

#ifdef DEBUG

#else

#    pragma GCC optimize("O3,no-stack-protector")
#    pragma GCC optimize("unroll-loops")

#    if __cplusplus < 201703L
#        pragma GCC target("avx")
#    else
#        pragma GCC target("avx2")
#    endif

#endif

#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#include <random>
#define dump(x) cout << x << endl
typedef int64_t Int;
typedef long double Ld;

using namespace std;
using Graph = vector<vector<Int>>;

const Ld pi = M_PI;
const Int MOD = 1000000007;
const Int INF = 1LL << 61;

Int Floor(Int a, Int b) {
    return (a - (a % b)) / b;
}

const Int alp = 26;

Int compute_score(Int &D, vector<vector<Int>> &s, vector<Int> &c, vector<Int> &out) {
    Int score = 0;
    vector<Int> last(alp, 0);

    for (Int d = 0; d < out.size(); d++) {
        last[out[d]] = d + 1;

        for (Int i = 0; i < alp; i++) {
            score -= (d + 1 - last[i]) * c[i];
        }
        score += s[d][out[d]];
    }

    return score;
}

Int evaluate(Int &D, vector<vector<Int>> &s, vector<Int> &c, vector<Int> &out, Int &k) {
    Int score = 0;
    vector<Int> last(alp, 0);

    for (Int d = 0; d < out.size(); d++) {
        last[out[d]] = d + 1;

        for (Int i = 0; i < alp; i++) {
            score -= (d + 1 - last[i]) * c[i];
        }
        score += s[d][out[d]];
    }

    Int count = min(D, out.size() + k);
    for (Int d = out.size(); d < count; d++) {
        for (Int i = 0; i < alp; i++) {
            score -= (d + 1 - last[i]) * c[i];
        }
    }

    return score;
}

vector<Int> solve(Int &D, vector<vector<Int>> &s, vector<Int> &c, Int &k) {
    vector<Int> out;

    for (Int _ = 0; _ < D; _++) {
        Int max_score = -INF;
        Int best_i = 0;

        for (Int i = 0; i < alp; i++) {
            out.push_back(i);

            Int score = evaluate(D, s, c, out, k);
            if (max_score < score) {
                max_score = score;
                best_i = i;
            }

            out.pop_back();
        }

        out.push_back(best_i);
    }

    return out;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    Int D;
    cin >> D;
    vector<Int> c(alp);
    vector<vector<Int>> s(D, vector<Int>(alp));
    for (Int i = 0; i < alp; i++) {
        cin >> c[i];
    }
    for (Int i = 0; i < D; i++) {
        for (Int j = 0; j < alp; j++) {
            cin >> s[i][j];
        }
    }

    Int k = 13;
    auto ans = solve(D, s, c, k);
    for (auto e : ans) {
        cout << e + 1 << endl;
    }

    return 0;
}


Compiler output:
a.cc: In function 'Int evaluate(Int&, std::vector<std::vector<long int> >&, std::vector<long int>&, std::vector<long int>&, Int&)':
a.cc:65:20: error: no matching function for call to 'min(Int&, long unsigned int)'
   65 |     Int count = min(D, out.size() + k);
      |                 ~~~^~~~~~~~~~~~~~~~~~~
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:17:
/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:65:20: note:   deduced conflicting types for parameter 'const _Tp' ('long int' and 'long unsigned int')
   65 |     Int count = min(D, out.size() + k);
      |                 ~~~^~~~~~~~~~~~~~~~~~~
/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:65:20: note:   mismatched types 'std::initializer_list<_Tp>' and 'long int'
   65 |     Int count = min(D, out.size() + k);
      |                 ~~~^~~~~~~~~~~~~~~~~~~