|
- #include<iostream>
- #include<algorithm>
- #define FOR(i,a,b) for(int i=a;i<=b;i++)
- using namespace std;
- const int N=2005;
- int n,tj[N],qw[N],ans,i,j,ii,jj;
- int main()
- {
- cin>>n;FOR(i,1,n)cin>>tj[i];FOR(i,1,n)cin>>qw[i];
- sort(tj+1,tj+n+1,greater<int>());sort(qw+1,qw+n+1,greater<int>());
- i=1;j=1;ii=n;jj=n;
- while(i<=ii)
- {
- if(tj[i]>qw[j]){ans+=200;i++;j++;continue;}
- else if(tj[i]<qw[j]){ans-=200;ii--;j++;continue;}
- else
- {
- if(tj[ii]>qw[jj]){ans+=200;ii--;jj--;continue;}
- else if(tj[ii]<qw[j]){ans-=200;ii--;j++;continue;}
- }
- i++,j++;
- }
- cout<<ans<<endl;
- return 0;
- }
复制代码 |
|