Language: C++

#include <functional>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <string>
#include <vector>
#include <random>
#include <bitset>
#include <queue>
#include <cmath>
#include <stack>
#include <set>
#include <map>
typedef long long ll;
using namespace std;
const ll MOD = 1000000007LL;

int main() {
    int D;
    cin >> D;
    vector<int> c(26);
    for (int i = 0; i < 26; i++) cin >> c[i];
    vector<vector<int>> s(D, vector<int>(26));
    for (int i = 0; i < D; i++) {
        for (int j = 0; j < 26; j++) {
            cin >> s[i][j];
        }
    }
    int ans = 0;
    vector<int> last(26, -1);
    for (int i = 0; i < D; i++) {
        int mx = -(1 << 30), idx = 0;
        for (int j = 0; j < 26; j++) {
            int tmp = s[i][j];
            for (int k = 0; k < 26; k++) {
                if (j == k) continue;
                tmp -= c[k] * (i - last[k]);
            }
            if (tmp > mx) {
                mx = tmp;
                idx = j;
            }
        }
        ans += mx;
        last[idx] = i;
    }
    cout << max(1e6 + ans, 0) << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:48:16: error: no matching function for call to 'max(double, int)'
   48 |     cout << max(1e6 + ans, 0) << endl;
      |             ~~~^~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/hashtable_policy.h:36,
                 from /usr/include/c++/14/bits/hashtable.h:35,
                 from /usr/include/c++/14/bits/unordered_map.h:33,
                 from /usr/include/c++/14/unordered_map:41,
                 from /usr/include/c++/14/functional:63,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:48:16: note:   deduced conflicting types for parameter 'const _Tp' ('double' and 'int')
   48 |     cout << max(1e6 + ans, 0) << endl;
      |             ~~~^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303: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:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:48:16: note:   mismatched types 'std::initializer_list<_Tp>' and 'double'
   48 |     cout << max(1e6 + ans, 0) << endl;
      |             ~~~^~~~~~~~~~~~~~