Submission #1099778

#TimeUsernameProblemLanguageResultExecution timeMemory
1099778model_codeNile (IOI24_nile)C++17
Compilation error
0 ms0 KiB
// 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 (stderr)

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>