Submission #344249

#TimeUsernameProblemLanguageResultExecution timeMemory
344249katearimaStar triangles (IZhO11_triangle)C++14
100 / 100
671 ms12396 KiB
#include <bits/stdc++.h> #define ss second #define ff first using namespace std; const int N=3e5+10; int n, x[N], y[N], ans; map<int, int> fx, fy; main(){ cin>>n; for(int i=0; i<n; i++){ cin>>x[i]>>y[i]; fx[x[i]]++; fy[y[i]]++; } for(int i=0; i<n; i++){ ans+=(fx[x[i]]-1)*(fy[y[i]]-1); } cout<<ans<<endl; }

Compilation message (stderr)

triangle.cpp:8:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    8 | main(){
      |      ^
#Verdict Execution timeMemoryGrader output
Fetching results...