0
孙晨曦
高级守护
高级守护
- #include<iostream>
- #include<algorithm>
- using namespace std;
- int n,a[1005],b[1005],win,lose;
- int main(){
- cin>>n;
- for(int i=1;i<=n;i++)
- cin>>a[i];
- sort(a+1, a+n+1);
- for(int i=1;i<=n;i++)
- cin>>b[i];
- sort(b+1, b+n+1);
- int l1=1,r1=n;
- int l2=1,r2=n;
- while(l1<=r1){
- if(a[r1]>b[r2]){
- r1--;
- r2--;
- win++;
- }else if(a[r1]<b[r2]){
- lose++;
- l1++;
- r2--;
- }else{
- if(a[l1]>b[l2]){
- l1++;
- l2++;
- win++;
- }else{
- if(a[l1]>b[r2])
- lose++;
- l1++;
- r2++;
- }
- }
- }
- cout<<50*(win-lose);
- return 0;
- }