제출 #868984

#제출 시각아이디문제언어결과실행 시간메모리
868984tch1cherin자매 도시 (APIO20_swap)C++17
컴파일 에러
0 ms0 KiB
#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;
}

컴파일 시 표준 에러 (stderr) 메시지

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;
      |                        ^~~~~~~~~~~