# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
887307 | alex_2008 | Star triangles (IZhO11_triangle) | C++14 | 374 ms | 12120 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.
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cmath>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <fstream>
#include <bitset>
typedef long long ll;
using namespace std;
const int N = 3e5 + 10;
int x[N], y[N];
int main() {
int n;
cin >> n;
map <int, int> mpx, mpy;
for (int i = 1; i <= n; i++) {
cin >> x[i] >> y[i];
mpx[x[i]]++;
mpy[y[i]]++;
}
ll ans = 0;
for (int i = 1; i <= n; i++) {
ans += (mpx[x[i]] - 1) * 1ll * (mpy[y[i]] - 1);
}
cout << ans << "\n";
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |