#include<iostream>
using namespace std;
int main()
{
int N,min=1000000,max=0,m,n;
long arry[20000];
cin >> N;
for (int i = 0; i < N; i++)
{
cin >> arry[i];
if (arry[i] < min)
{
min = arry[i];
m = 1;
}
else if (arry[i] == min)
m++;
if (arry[i] > max)
{
max = arry[i];
n = 1;
}
else if (arry[i] == max)
n++;
}
cout << min << ' ' << m << endl << max << ' ' << n;
}
团体程序设计天梯赛 L1-079 天梯赛的善良
最新推荐文章于 2024-09-02 23:09:18 发布