Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define REP2(i,x,n) for(int i=x; i<(n); i++)
#define ALL(n) begin(n),end(n)
#define sz(x) int(x.size())
using ll = long long;
using P = pair<int,int>;
const ll LLINF = numeric_limits<long long>::max();
const int mod = 1000000007;
const int INF = 1001001001;
 
int main()
{
    int N,M,X;
    cin >> N >>M >>X;
    vector <int> C(N);
    int  A[N][M];
    int W[M];
    for(int i=0;i<N;i++){
        cin >> C[i];
        for(int j=0;j<M;j++){
             cin >> A[i][j];
             W[i] = 0;
        }
    }
    ll ans = 10000000000;
    
    int n=N;
    int co=1;
    
    rep(div,1<<(N)) {
        int g = 0;
        vector<int> id(M);
        bool flag = true;
        ll cos=0; 
        //cout << "sss"<<div << endl;
        rep(i,N) {
        // cout << div;
        int d = div;
            if (d>>i&1){
                for(int j=0;j<M;j++){
                    //cout << "j " << j  << endl;
                    //cout << "a "<<A[i][j] << endl;
                    id[j] += A[i][j];
                    //cout << "id "<<id[j] << endl;
                    
                    
                    
                }
                cos += C[i];
        
                
            }
        }
        for(int j=0;j<M;j++){
            //cout << id[j] << " ";  
            if(id[j] < X){
                flag=false;
            }
        }
        //cout << endl;
        if(flag){
            ans = min(ans, cos);
        }
    }   
    if(ans == 10000000000){
        ans =-1;
    }
    cout << ans;
 
 
 
    return 0;
}
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define REP2(i,x,n) for(int i=x; i<(n); i++)
#define ALL(n) begin(n),end(n)
#define sz(x) int(x.size())
using ll = long long;
using P = pair<int,int>;
const ll LLINF = numeric_limits<long long>::max();
const int mod = 1000000007;
const int INF = 1001001001;

int main()
{
    int N,M,X;
    cin >> N >>M >>X;
    vector <int> C(N);
    int  A[N][M];
    int W[M];
    for(int i=0;i<N;i++){
        cin >> C[i];
        for(int j=0;j<M;j++){
             cin >> A[i][j];
             W[i] = 0;
        }
    }
    int ans = 1000000;
    
    int n=N;
    int co=1;
    
    rep(div,1<<(N)) {
        int g = 0;
        vector<int> id(M);
        bool flag = true;
        ll cos=0; 
        //cout << "sss"<<div << endl;
        rep(i,N) {
        // cout << div;
        int d = div;
            if (d>>i&1){
                for(int j=0;j<M;j++){
                    //cout << "j " << j  << endl;
                    //cout << "a "<<A[i][j] << endl;
                    id[j] += A[i][j];
                    //cout << "id "<<id[j] << endl;
                    
                    
                    
                }
                cos += C[i];
        
                
            }
        }
        for(int j=0;j<M;j++){
            //cout << id[j] << " ";  
            if(id[j] < X){
                flag=false;
            }
        }
        //cout << endl;
        if(flag){
            ans = min(ans, cos);
        }
    }   
    if(ans == 1000000){
        ans =-1;
    }
    cout << ans;



    return 0;
}
提出情報

Compiler output:
a.cc:84:10: error: redefinition of 'const ll LLINF'
   84 | const ll LLINF = numeric_limits<long long>::max();
      |          ^~~~~
a.cc:9:10: note: 'const ll LLINF' previously defined here
    9 | const ll LLINF = numeric_limits<long long>::max();
      |          ^~~~~
a.cc:85:11: error: redefinition of 'const int mod'
   85 | const int mod = 1000000007;
      |           ^~~
a.cc:10:11: note: 'const int mod' previously defined here
   10 | const int mod = 1000000007;
      |           ^~~
a.cc:86:11: error: redefinition of 'const int INF'
   86 | const int INF = 1001001001;
      |           ^~~
a.cc:11:11: note: 'const int INF' previously defined here
   11 | const int INF = 1001001001;
      |           ^~~
a.cc:88:5: error: redefinition of 'int main()'
   88 | int main()
      |     ^~~~
a.cc:13:5: note: 'int main()' previously defined here
   13 | int main()
      |     ^~~~
a.cc: In function 'int main()':
a.cc:139:22: error: no matching function for call to 'min(int&, ll&)'
  139 |             ans = min(ans, cos);
      |                   ~~~^~~~~~~~~~
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:139:22: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
  139 |             ans = min(ans, cos);
      |                   ~~~^~~~~~~~~~
/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:139:22: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
  139 |             ans = min(ans, cos);
      |                   ~~~^~~~~~~~~~
a.cc: At global scope:
a.cc:151:1: error: '\U000063d0\U000051fa\U000060c5\U00005831' does not name a type
  151 | 提出情報
      | ^~~~~~~~