Submission #21608

#TimeUsernameProblemLanguageResultExecution timeMemory
21608nona1314최댓값 (tutorial2)C++11
Compilation error
0 ms0 KiB
#include <algorithm> int GetMax(int N, int *A){ int ret = A[0]; for (int i = 0; i < N; ++i) { ret = max(ret, A[i]); } return ret; }

Compilation message (stderr)

tutorial2.cpp: In function 'int GetMax(int, int*)':
tutorial2.cpp:6:28: error: 'max' was not declared in this scope
         ret = max(ret, A[i]);
                            ^
tutorial2.cpp:6:28: note: suggested alternative:
In file included from /usr/include/c++/5/algorithm:62:0,
                 from tutorial2.cpp:1:
/usr/include/c++/5/bits/stl_algo.h:3463:5: note:   'std::max'
     max(initializer_list<_Tp> __l, _Compare __comp)
     ^