# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
913459 | daoquanglinh2007 | Star triangles (IZhO11_triangle) | C++17 | 417 ms | 15700 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 int long long
const int NM = 3e5;
int N, x[NM+5], y[NM+5], ans = 0;
map <int, int> f, g;
signed main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin >> N;
for (int i = 1; i <= N; i++){
cin >> x[i] >> y[i];
f[x[i]]++;
g[y[i]]++;
}
for (int i = 1; i <= N; i++){
ans += (f[x[i]]-1)*(g[y[i]]-1);
}
cout << ans;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |