#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
using namespace std;
long long n,a[100005],najm=1000000001,najv;
int main () {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin >> n;
for (int i = 0;i<n;i++){
cin >> a[i];
if (a[i] > najv)
najv = a[i];
if (a[i] < najm)
najm = a[i];
}
cout << najv-najm;
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
2 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
3 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
4 |
Incorrect |
3 ms |
376 KB |
Output isn't correct |
5 |
Incorrect |
15 ms |
1912 KB |
Output isn't correct |
6 |
Incorrect |
16 ms |
2040 KB |
Output isn't correct |
7 |
Incorrect |
15 ms |
1912 KB |
Output isn't correct |