Advertisement
Promi_38

cf - ball

Oct 17th, 2021
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. #include <bits\stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5.  
  6. int main()
  7. {
  8.     long long n, i, j;
  9.     cin >> n;
  10.    
  11.     long long a[n], b[n], c[n];
  12.     for(i = 0; i < n; i++) cin >> a[i] >> b[i] >> c[i];
  13.    
  14.     long long cnt = 0;
  15.     for(i = 0; i < n - 1; i++)
  16.     {
  17.         for(j = i + 1; j < n; j++)
  18.         {
  19.             if((a[i] > a[j] && b[i] > b[j] && c[i] > c[j]) || (a[i] < a[j] && b[i] < b[j] && c[i] < c[j])) cnt++;
  20.         }
  21.     }
  22.     cout << cnt << endl;
  23. }
  24.  
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement