Submission #862933

# Submission time Handle Problem Language Result Execution time Memory
862933 2023-10-19T11:43:25 Z MilosMilutinovic 최댓값 (tutorial2) C++14
Compilation error
0 ms 0 KB
#include <algorithm>

int GetMax(int n,int* a){
	return *max_element(a,a+n);
}

Compilation message

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