|
|
back to boardDiscussion of Problem 1273. TiePlease help anybody(What a ucking tests are there??) Posted by Emil 1 Mar 2008 00:13 #include <iostream.h> int main() {int K,max; cin>>K; int **a=new int*[K]; for (int i=0;i<2;i++) a[i]=new int[K]; for (int i=0;i<K;i++) for (int j=0;j<2;j++) cin>>a[j][i]; int *b=new int[2000]; for (int i=0;i<2000;i++) b[i]=0; for (int i=0;i<K;i++) if (a[0][i]>a[1][i]) b[a[0][i]-a[1][i]]++; else b[a[1][i]-a[0][i]+1000]++; max=b[0]; for (int i=1;i<2000;i++) if (b[i]>max) max=b[i]; cout<<K-max<<endl; //cin>>K; } ????? |
|
|