Submission #862933

#TimeUsernameProblemLanguageResultExecution timeMemory
862933MilosMilutinovic최댓값 (tutorial2)C++14
Compilation error
0 ms0 KiB
#include <algorithm> int GetMax(int n,int* a){ return *max_element(a,a+n); }

Compilation message (stderr)

tutorial2.cpp: In function 'int GetMax(int, int*)':
tutorial2.cpp:4:10: error: 'max_element' was not declared in this scope; did you mean 'std::max_element'?
    4 |  return *max_element(a,a+n);
      |          ^~~~~~~~~~~
      |          std::max_element
In file included from /usr/include/c++/10/algorithm:62,
                 from tutorial2.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:5740:5: note: 'std::max_element' declared here
 5740 |     max_element(_ForwardIterator __first, _ForwardIterator __last,
      |     ^~~~~~~~~~~