# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1257436 | dhanan | Star triangles (IZhO11_triangle) | C++20 | 473 ms | 9216 KiB |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
ll N; cin >> N;
vector<ll> x(N + 1), y(N + 1);
map<ll, ll> barista, kolombus;
ll ans = 0;
for(int i = 1; i <= N; i++){
cin >> x[i] >> y[i];
barista[x[i]]++;
kolombus[y[i]]++;
}
for(int i = 1; i <= N; i++){
ll ans_x = barista[x[i]]-1;
ll ans_y = kolombus[y[i]]-1;
ans += ans_x * ans_y;
}
cout << ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |