会场安排问题
作者:互联网
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
int n, i;
cin >> n;
int b[n],e[n];
for (i = 0; i < n; i++)
cin >> b[i] >> e[i];
sort(b,b+n);
sort(e,e+n);
int f[n];
for(int i=1;i<=n;i++){
f[i]=1;
}
int j=0,ans =0;
for (i = 0; i < n; i++)
if (b[i] < e[j])
ans++;
else
j++;
cout << ans << endl;
return 0;
}
标签:sort,int,安排,cin,问题,++,会场,ans,include 来源: https://blog.csdn.net/qijingke123/article/details/121246032