ZOJ Problem Set - 2397 Tian Ji -- The Horse Racing

时间:2023-03-08 16:05:10
#include<iostream>
#include<cmath>
#include<algorithm>
#define REP(i,n) for(int i=0;i<(n);i++)
using namespace std;
int a[],b[],n;
int main(){
while (cin>>n,n){
REP(i,n)cin>>a[i];
REP(i,n)cin>>b[i];
sort(a,a+n);
sort(b,b+n);
int ha=,ta=n-,hb=,tb=n-,ans=;
REP(i,n){
if (a[ha]>b[hb])ans++,ha++,hb++;
else if (a[ta]>b[tb])ans++,ta--,tb--;
else ans-=(a[ha]!=b[tb]),ha++,tb--;
}
cout<<ans*<<endl;
}
return ;
}

#define 用起来