daily pastebin goal
15%
SHARE
TWEET

Persian Party

a guest Mar 3rd, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  
  3. int main(){
  4.     unsigned long n;
  5.         std::cin>> n;
  6.        
  7.     unsigned long a[n], d[n], i=0;
  8.         for(i=0; i<n; i++){
  9.             std::cin>> a[i];
  10.             std::cin>> d[i];
  11.         }
  12.        
  13.     unsigned long j=0, v=0; i=0;
  14.  
  15.     while(true){
  16.        
  17.         if(j==n-1){
  18.            
  19.             if(i==j){
  20.                 break;
  21.             }
  22.             else{
  23.                 i++; j=0;
  24.             }
  25.         }
  26.         else
  27.             j++;
  28.                
  29.         if(a[i]<d[j]){
  30.            
  31.             if(a[i]>a[j])
  32.                 v++;
  33.         }
  34.     }
  35.     std::cout<<(v+n)*2;
  36. }
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