# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
406313 | saarang123 | Star triangles (IZhO11_triangle) | C++17 | 358 ms | 12136 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;
signed main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
map<int, int> x, y;
int n; cin >> n;
vector<array<int, 2>> a(n);
for(auto& [i, j] : a){
cin >> i >> j;
x[i]++;
y[j]++;
}
long long ans = 0;
for(int i = 0; i < n; i++)
ans += (x[a[i][0]] - 1) * 1LL * (y[a[i][1]] - 1);
cout << ans << '\n';
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |