Submission #532093

#TimeUsernameProblemLanguageResultExecution timeMemory
532093kebineStar triangles (IZhO11_triangle)C++17
0 / 100
2074 ms588 KiB
#include <bits/stdc++.h>
#define pb push_back
#define fi first
#define se second
typedef long long ll;
using namespace std;

ll n, ans;
pair<ll,ll>arr[300005];

int main(){
  cin >> n;
  for(int i = 0; i < n; i++){
    cin >> arr[i].fi >> arr[i].se;
  }
  for(int i = 0; i < n; i++){
    for(int j = 0; j < n; j++){
      if(i==j)continue;
      for(int k = 0; k < n; k++){
        if(j==k || i == k) continue;
        if(arr[i].fi == arr[j].fi && arr[j].se == arr[k].se){
          ans++;
        }
      }
    }
  }
  cout << ans << endl;
}

//tle lmao
#Verdict Execution timeMemoryGrader output
Fetching results...