# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
532293 | christinelynn | Star triangles (IZhO11_triangle) | C++17 | 540 ms | 11372 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 ll long long
#define fi first
#define se second
const ll MOD=1e9+7;
using namespace std;
ll N;
pair <ll,ll> pr[300005];
map <ll,ll> x;
map <ll,ll> y;
int main(){
cin>>N;
for(int i=1;i<=N;i++){
cin>>pr[i].fi>>pr[i].se;
x[pr[i].fi]++;
y[pr[i].se]++;
}
ll ans=0;
for(int i=1;i<=N;i++){
ans+=(x[pr[i].fi]-1)*(y[pr[i].se]-1);
}
cout<<ans<<endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |