Submission #1099778

# Submission time Handle Problem Language Result Execution time Memory
1099778 2024-10-12T05:15:31 Z model_code Nile (IOI24_nile) C++17
Compilation error
0 ms 0 KB
// incorrect/arshia_sub2_heuristic.cpp

#include "nile.h"
#include <vector>
using namespace std;

vector<long long> calculate_costs(vector<int> W, vector<int> A, vector<int> B, vector<int> E) {
    long long total = 0;
    int n = W.size(), mn = INT_MAX;
    for (int i = 0; i < n; i++) {
        total += B[i];
        mn = min(mn, A[i] - B[i]);
    }
    return vector<long long>(E.size(), n & 1 ? total + mn : total);
}

Compilation message

nile.cpp: In function 'std::vector<long long int> calculate_costs(std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>)':
nile.cpp:9:28: error: 'INT_MAX' was not declared in this scope
    9 |     int n = W.size(), mn = INT_MAX;
      |                            ^~~~~~~
nile.cpp:4:1: note: 'INT_MAX' is defined in header '<climits>'; did you forget to '#include <climits>'?
    3 | #include "nile.h"
  +++ |+#include <climits>
    4 | #include <vector>