# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
671619 | smartmonky | Star triangles (IZhO11_triangle) | C++14 | 277 ms | 9084 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 ff first
#define ss second
#define pb push_back
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define int long long
using namespace std;
int n;
map <int,int> x, y;
main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin >> n;
vector <pair <int,int> > vp(n);
for(int i = 0; i < n; i++){
cin >> vp[i].ff >> vp[i].ss;
x[vp[i].ff]++;
y[vp[i].ss]++;
}
int ans = 0;
for(auto f : vp){
ans += (x[f.ff] - 1) * (y[f.ss] - 1);
}
cout << ans;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |