Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits\stdc++.h>
- using namespace std;
- int main()
- {
- long long n, i, j;
- cin >> n;
- long long a[n], b[n], c[n];
- for(i = 0; i < n; i++) cin >> a[i] >> b[i] >> c[i];
- long long cnt = 0;
- for(i = 0; i < n - 1; i++)
- {
- for(j = i + 1; j < n; j++)
- {
- 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++;
- }
- }
- cout << cnt << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement