# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
975209 | vjudge1 | Star triangles (IZhO11_triangle) | C++17 | 275 ms | 12832 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>
using namespace std;
#define ll long long
const int N = 3e5 + 5;
map < ll, ll > mpx, mpy;
vector < pair < ll, ll >> a ( N );
ll n;
signed main(){
ios_base::sync_with_stdio(0); cin.tie(0);
cin >> n;
for ( int i = 1; i <= n; i++){
cin >> a[i].first >> a[i].second;
mpx[a[i].first]++;
mpy[a[i].second]++;
}
ll ans = 0;
for ( int i = 1; i <= n; i++){
ans += ( 1ll * ( mpx[a[i].first] - 1 ) * ( mpy[a[i].second] - 1) );
}
cout << ans << endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |