Submission #836527

# Submission time Handle Problem Language Result Execution time Memory
836527 2023-08-24T12:19:52 Z NaimSS Friend (IOI14_friend) C++14
Compilation error
0 ms 0 KB
#include "friend.h"
using namespace std;

// Find out best sample
int findSample(int n,int confidence[],int host[],int protocol[]){
	int sum = 0;
	int mx=0;
	for(int i=0;i<n;i++){
		sum += confidence[i];
		mx = max(mx,confidence[i]);
	}
	return mx;
}

Compilation message

friend.cpp: In function 'int findSample(int, int*, int*, int*)':
friend.cpp:10:8: error: 'max' was not declared in this scope; did you mean 'mx'?
   10 |   mx = max(mx,confidence[i]);
      |        ^~~
      |        mx