Submission #874020

#TimeUsernameProblemLanguageResultExecution timeMemory
874020OSoverspikeFriend (IOI14_friend)C++17
Compilation error
0 ms0 KiB
#include "friend.h" // Find out best sample int findSample(int n,int confidence[],int host[],int protocol[]){ int ans=0; if (protocol[1]==1) { for (int a=0; a<=n; a++) { ans+=confidence[a]; } } else { for (int a=0; a<=n; a++) { ans=max(ans, confidence[a]); } } return ans; }

Compilation message (stderr)

friend.cpp: In function 'int findSample(int, int*, int*, int*)':
friend.cpp:12:17: error: 'max' was not declared in this scope
   12 |             ans=max(ans, confidence[a]);
      |                 ^~~