提交时间:2023-12-23 11:19:29
运行 ID: 225077
#include<bits/stdc++.h> using namespace std; int a[114514]; int b[114514]; int sum; int t; bool cmp(int y,int ee) { return y>ee; }; int main() { int n; cin>>n; bool f=0; for(int i=1; i<=n; i++) cin>>a[i]; sort(a+1,a+n+1,cmp); for(int i=1; i<=n; i++) cin>>b[i]; sort(b+1,b+n+1,cmp); for(int i=1; i<=n; i++) { bool yee=0; for(int j=1; j<=n; j++) { if(a[i]>b[j]&&b[j]!=114) { yee=1; sum++; b[j]=114; break; } } if(yee==0) break; } cout<<sum; }