#include <bits/stdc++.h>
using namespace std;
int n;
multiset<int> s;
int main()
{
cin >> n;
while(n --)
{
int t;
cin >> t;
s.insert(t);
}
cout << *s.begin() << ' ' << s.count(*s.begin()) << endl;
cout << *s.rbegin() << ' ' << s.count(*s.rbegin()) << endl;
}
【天梯赛】L1-079 天梯赛的善良(STL之multiset的应用)
最新推荐文章于 2022-11-05 17:35:27 发布