#include<iostream> #include<algorithm> using namespace std; bool comp(int a,int b) { return a>b; } int main() { int n; while(cin>>n && n) { int ts,te,ks,ke,i,wins,loses; int tj[1001],king[1001]; for(i=1;i<=n;i++) scanf("%d",&tj[i]); for(i=1;i<=n;i++) scanf("%d",&king[i]); sort(tj+1,tj+n+1,comp); sort(king+1,king+n+1,comp); ts = ks = 1; te = ke = n; wins = loses = 0; while(1) { if(ts > te || ks > ke) break; if(tj[ts] > king[ks]) //最快的赢了 { ts++; ks++; wins++; continue; } else if(tj[ts] < king[ks])//最快的输了 { te--; ks++; loses++; continue; }
if(tj[te] > king[ke]) //最慢的赢了 { te--; ke--; wins++; continue; } else if(tj[te] < king[ke])//最慢的输了 { te--; ks++; loses++; continue; }
if(tj[te] < king[ks]) //最慢与最快 loses++; te--; ks++; } cout<<200*(wins-loses)<<endl; } return 0; }
|