# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
914942 | adaawf | Star triangles (IZhO11_triangle) | C++14 | 246 ms | 12600 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 <iostream>
#include <map>
using namespace std;
int a[300005], b[300005];
map<int, int> ma, mb;
int main() {
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
int n;
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> a[i] >> b[i];
ma[a[i]]++;
mb[b[i]]++;
}
long long int res = 0;
for (int i = 1; i <= n; i++) {
res += 1ll * (ma[a[i]] - 1) * (mb[b[i]] - 1);
}
cout << res;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |