# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
932442 | Aiperiii | Star triangles (IZhO11_triangle) | C++14 | 410 ms | 21824 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define int long long
#define ff first
#define ss second
#define all(x) x.begin(),x.end()
#define pb push_back
using namespace std;
signed main(){
ios_base::sync_with_stdio();
cin.tie(0);cout.tie(0);
int n;
cin>>n;
map <int,vector <int> > xy,yx;
for(int i=0;i<n;i++){
int x,y;cin>>x>>y;
xy[x].pb(y);
yx[y].pb(x);
}
int ans=0;
for(auto i : xy){
for(auto y : i.ss){
ans+=((i.ss.size()-1)*(yx[y].size()-1));
}
}
cout<<ans<<"\n";
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |