#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
int n;
cin>>n;
vector<int>heights(n);
for(int i=0;i<n;i++)
{
cin>>heights[i];
}
sort(heights.begin(),heights.end());
int rooms=1;
int current_room=0;
for(int i=1;i<n;i++)
{
if(heights[i]>heights[i-1])
{
current_room++;
}
rooms=max(rooms,current_room+1);
}
cout<<rooms<<endl;
return 0;
}
第2题 房间数量
最新推荐文章于 2024-08-21 18:16:36 发布