SHARE
TWEET

Persian Party

a guest Mar 4th, 2019 85 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. int main(){
  3.     unsigned long n;
  4.         std::cin>> n;
  5.        
  6.     unsigned long a[n], d[n], i=0, j=0, v=0;
  7.         for(i=0; i<n; i++){
  8.             std::cin>> a[i];
  9.             std::cin>> d[i];
  10.         }
  11.  
  12.     for(i=0; i<n; i++){
  13.         for(j=0; j<n; j++){      
  14.             if(a[i]<d[j]){       
  15.                 if(a[i]>a[j])
  16.                     v++;
  17.             }
  18.         }
  19.     }
  20.     std::cout<<(v+n)*2;
  21. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top