Submission #119565

#TimeUsernameProblemLanguageResultExecution timeMemory
119565Diuven최댓값 (tutorial2)C++14
Compilation error
0 ms0 KiB
int GetMax(int n, int A[]){ int mx = -1e9; for(int i=0; i<n; i++) mx = max(mx, A[i]); return mx; }

Compilation message (stderr)

tutorial2.cpp: In function 'int GetMax(int, int*)':
tutorial2.cpp:3:31: error: 'max' was not declared in this scope
   for(int i=0; i<n; i++) mx = max(mx, A[i]);
                               ^~~
tutorial2.cpp:3:31: note: suggested alternative: 'mx'
   for(int i=0; i<n; i++) mx = max(mx, A[i]);
                               ^~~
                               mx