Submission #491566

#TimeUsernameProblemLanguageResultExecution timeMemory
491566osmanallazovStar triangles (IZhO11_triangle)C++14
100 / 100
514 ms13168 KiB
#include<bits/stdc++.h> #define ll long long using namespace std; int main(){ ll n,x,y; ll res=0; map<ll,ll>m,p; cin>>n; int a[n],b[n]; for(int i=0;i<n;i++){ cin>>a[i]>>b[i]; m[a[i]]++; p[b[i]]++; } for(int i=0;i<n;i++){ res+=((m[a[i]]-1)*(p[b[i]]-1)); } cout<<res; }

Compilation message (stderr)

triangle.cpp: In function 'int main()':
triangle.cpp:5:10: warning: unused variable 'x' [-Wunused-variable]
    5 |     ll n,x,y;
      |          ^
triangle.cpp:5:12: warning: unused variable 'y' [-Wunused-variable]
    5 |     ll n,x,y;
      |            ^
#Verdict Execution timeMemoryGrader output
Fetching results...