Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define MM = 1000000000;
#define mod = MM + 7;
#define INF (ll)1e18
#define pi acos(-1.0)
#define MAX 100005
#define NIL -1
#define rep(i, n) for(int i = 0; i < n; i++)
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};
int main(){
    //入力
    int n, C; cin >> n >> C;
    int D[C][C];
    int c[n][n];
    vector<int> v0, v1, v2;
    ll sum = 0;
    ll mn = 100000000000000000000;
    ll mn0 = 1000000000, mn1 = 100000000, mn2 = 10000000000;
    ll ans = 0;
    rep(i, C){
        rep(j, C){
            cin >> D[i][j];
        }
    }
    int color[3][30] = {0};
    rep(i, n){
        rep(j, n){
            cin >> c[i][j];
            color[(i+j)%3][c[i][j]-1]++;
        }
    }
    rep(i, n){
        rep(j, n){
            if(i != j){
                rep(k, n){
                    if(i != k && j != k){
                        int tt = 0;
                        rep(l,C) tt += D[l][i]*color[0][l];
                        rep(l,C) tt += D[l][j]*color[1][l];
                        rep(l,C) tt += D[l][k]*color[2][l];
                        mn = min(mn, tt); 
                    }
                }
            }
        }
    }
    cout << mn << endl;
}

Compiler output:
a.cc:20:13: warning: integer constant is too large for its type
   20 |     ll mn = 100000000000000000000;
      |             ^~~~~~~~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:44:33: error: no matching function for call to 'min(ll&, int&)'
   44 |                         mn = min(mn, tt);
      |                              ~~~^~~~~~~~
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:44:33: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   44 |                         mn = min(mn, tt);
      |                              ~~~^~~~~~~~
/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:44:33: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   44 |                         mn = min(mn, tt);
      |                              ~~~^~~~~~~~