Submission #1774600


Source Code Expand

#include<cstdio>
#include<iostream>
using namespace std;

const int MAX_N = 100;
int n, a[MAX_N];
int MAX = 0, MIN = 1000;

int main() {
	cin >> n;
	for (int i = 0; i < n; i++) cin >> a[i];

	for (int i = 0; i < n; i++) {
		if (a[i] > MAX) max = a[i];
		if (a[i] < MIN) min = a[i];
	}

	cout << MAX - MIN << endl;
	return 0;
}

Submission Info

Submission Time
Task B - Traveling AtCoDeer Problem
User Sashiming
Language C++14 (GCC 5.4.1)
Score 0
Code Size 345 Byte
Status CE

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:14:23: error: overloaded function with no contextual type information
   if (a[i] > MAX) max = a[i];
                       ^
./Main.cpp:15:23: error: overloaded function with no contextual type information
   if (a[i] < MIN) min = a[i];
                       ^