20000
The main topic: to Tian Bogey N horse, to the King N Horse, lose a round to reduce 200 yuan, win a round increase 200 yuan, draw not rewards and punishments. Ask how much money you can get at the end.
Problem-solving ideas: If the slow horse can win the King, win. If it is slower than the king, pull the King's fastest ponies, anyway lose, rather than lose more valuable, for behind the horse to reduce resistance. If the slow horse as fast as the first to see Tian Bogey's fastest horse is not faster than the king's fastest horse, if it is the fastest horse to win a game. If not, let Tian bogey's slowest horse compare with the King's fastest horse is not equal, if not, then lose a game; if so, let the slowest horse and the King draw the fastest horse.
#include <bits/stdc++.h>using namespace Std;int tj[1100],king[1100];int main () {int t,i,j,k,tmp,sum,cnt,n,m, Tslow,tfast,kslow,kfast; while (scanf ("%d", &n)!=eof) {memset (tj,0,sizeof (TJ)); memset (King,0,sizeof (king)); for (i=0;i<n;i++) {scanf ("%d", &tj[i]); } for (i=0;i<n;i++) {scanf ("%d", &king[i]); } sort (tj,tj+n); Sort (king,king+n); tslow=kslow=0; tfast=kfast=n-1; m=k=0; while (m<n) {if (Tj[tslow]>king[kslow]) {//Tian Bogey slow ponies king slow horse fast tslow++; kslow++; k++; }else if (Tj[tslow]<king[kslow]) {//Tian Bogey slow ponies king slow horse slow tslow++; kfast--; k--; }else{//Two people slow horse same speed if (Tj[tfast]>king[kfast]) {//Tian bogey pony faster than the King fast tfast--; kfast--; k++; }else {//Tian bogey horse is slower than or equal to the King's Horse if (Tj[tsloW]<king[kfast] {//Tian Bogey slow ponies king horse slow kfast--; tslow++; k--; }else if (Tj[tslow]==king[kfast]) {//Tian bogey slow horse equals King's Pony tslow++; kfast--; }}} m++; } cout<<k*200<<endl; } return 0;} /*58 6 5 1 3 9 7 6 4 2 * *