Submission #868984

# Submission time Handle Problem Language Result Execution time Memory
868984 2023-11-02T18:47:42 Z tch1cherin Swapping Cities (APIO20_swap) C++17
Compilation error
0 ms 0 KB
#include "swap.h"

#include <vector>

int ans;

void init(int N, int M,
          std::vector<int> U, std::vector<int> V, std::vector<int> W) {
  ans = N == M ? *std::max_element(W.begin(), W.end()) : 0;
}

int getMinimumFuelCapacity(int X, int Y) {
  return ans;
}

Compilation message

swap.cpp: In function 'void init(int, int, std::vector<int>, std::vector<int>, std::vector<int>)':
swap.cpp:9:24: error: 'max_element' is not a member of 'std'
    9 |   ans = N == M ? *std::max_element(W.begin(), W.end()) : 0;
      |                        ^~~~~~~~~~~