BoxerTC

Untitled

Jun 22nd, 2015
350
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.19 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. #define sc( x ) scanf( "%d" , &x )
  5. #define REP( i , n ) for( int i = 0 ; i < n ; i++ )
  6. #define clr( t , val ) memset( t , val , sizeof(t) )
  7.  
  8. #define all(v)  v.begin() , v.end()
  9. #define pb push_back
  10. #define SZ( v ) ((int)(v).size())
  11.  
  12. #define mp make_pair
  13. #define fi first
  14. #define se second
  15.  
  16. #define test() cout << "hola q hace" << endl;
  17. #define DEBUG( x ) cerr <<  #x << "=" << x << endl;
  18. #define DEBUG2( x , y ) cerr << #x << "=" << x << " " << #y << "=" << y << endl;
  19.  
  20.  
  21. #define MOD1 100003LL
  22. #define MOD2 100019LL
  23. #define MOD3 1000000007LL
  24. #define MOD4 1000000009LL
  25.  
  26. typedef long long ll;
  27. typedef pair< int , int > pii;
  28. typedef vector< pii > vpii;
  29. typedef vector< vpii > vvpii;
  30. typedef vector< vvpii > vvvpii;
  31. typedef vector< int > vi;
  32. typedef vector< vi > vvi;
  33. typedef vector< vvi > vvvi;
  34.  
  35. int main(){
  36.     int n;
  37.     while( sc( n ) == 1 ){
  38.         vvi T( 3 , vi( n ) );
  39.         REP( j , 3 ) REP( i , n ) sc( T[ j ][ i ] );
  40.         int a = 0 , b = 0;
  41.         REP( i , n ){
  42.             int x = abs( T[ 2 ][ i ] - T[ 0 ][ i ] );
  43.             int y = abs( T[ 2 ][ i ] - T[ 1 ][ i ] );
  44.             if( x < y ) a ++;
  45.             if( y < x ) b ++;
  46.         }
  47.        
  48.         printf( "%d %d\n" , a , b );
  49.     }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment