# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
884620 | Andrey | Star triangles (IZhO11_triangle) | C++14 | 0 ms | 348 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;
map<long long,long long> bruh;
map<long long,long long> idk;
map<pair<long long,long long>,long long> yay;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
long long n,a,b,ans = 0;
cin >> n;
vector<pair<long long,long long>> haha(n);
for(long long i = 0; i < n; i++) {
cin >> a >> b;
haha[i] = {a,b};
yay[{a,b}]++;
bruh[a]++;
idk[a]++;
}
for(long long i = 0; i < n; i++) {
a = haha[i].first;
b = haha[i].second;
long long c = yay[{a,b}];
ans+=(bruh[a]-c)*(idk[b]-c);
}
cout << ans;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |