problem statement is here
#include<stdio.h>
#include<algorithm>
using namespace std;
int main(){
long long int s,ar[100009],br[100009],i,j,z,p,a;
scanf("%lld",&s);
for(i=0;i<s;i++){
scanf("%lld",&ar[i]);
}
for(i=0;i<s;i++){
scanf("%lld",&br[i]);
}
sort(ar,ar+s);
sort(br,br+s);
z=s-1;p=0;
for(i=s-1;i>=0;i--){
if(ar[i]<br[z]){
p++;
z--;
}
}
printf("%lld\n",p);
return 0;
}
No comments:
Post a Comment