Submission #161997

#TimeUsernameProblemLanguageResultExecution timeMemory
161997mosiashvililuka별들과 삼각형 (IZhO11_triangle)C++14
100 / 100
558 ms15680 KiB
#include<bits/stdc++.h> using namespace std; long long a,b,c,d,e,pas; pair <long long, long long> p[300009]; map <long long, long long> x,y; int main(){ ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0); cin>>a; for(b=1; b<=a; b++){ cin>>p[b].first>>p[b].second; x[p[b].first]++; y[p[b].second]++; } for(b=1; b<=a; b++){ pas+=(x[p[b].first]-1)*(y[p[b].second]-1); } cout<<pas; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...