Submission #244289

#TimeUsernameProblemLanguageResultExecution timeMemory
244289kimbj0709최댓값 (tutorial2)C++14
Compilation error
0 ms0 KiB
int GetMax(int N, int *A){ int ans = -INT_MAX; for(int i=1;i<N;i++){ ans=max(ans,A[i]); } return ans; }

Compilation message (stderr)

tutorial2.cpp: In function 'int GetMax(int, int*)':
tutorial2.cpp:2:13: error: 'INT_MAX' was not declared in this scope
  int ans = -INT_MAX;
             ^~~~~~~
tutorial2.cpp:2:13: note: suggested alternative: '__INT_MAX__'
  int ans = -INT_MAX;
             ^~~~~~~
             __INT_MAX__
tutorial2.cpp:4:7: error: 'max' was not declared in this scope
   ans=max(ans,A[i]);
       ^~~