# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
889834 | Kakarot | Star triangles (IZhO11_triangle) | C++98 | 84 ms | 11872 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 ii unordered_map<int,int>
#define vi vector<int>
#define vii vector<pair<int,int>>
using namespace std;
void setIO() {
cin.tie(0)->sync_with_stdio(0);
}
void solve() {
int n,ans = 0;
cin >> n;
ii fx,fy;
vi X(n),Y(n);
for(int i = 0;i < n;++i) {
cin >> X[i] >> Y[i];
++fx[X[i]];
++fy[Y[i]];
}
for(int i = 0;i < n;++i)
ans += (fx[X[i]]-1)*(fy[Y[i]]-1);
cout << ans;
}
int main() {
setIO();
solve();
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |