# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
514822 | Be_dos | Star triangles (IZhO11_triangle) | C++17 | 588 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.
#include <iostream>
#include <cmath>
#include <cctype>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <deque>
#include <stack>
#include <unordered_set>
#include <sstream>
#include <cstring>
#include <iomanip>
#include <queue>
#include <unordered_map>
#include <random>
#include <cfloat>
#include <chrono>
#include <bitset>
#include <complex>
#include <immintrin.h>
#include <cassert>
int main() {
int32_t n;
std::cin >> n;
std::map<int32_t, int32_t> per_x, per_y;
std::pair<int32_t, int32_t>* points = new std::pair<int32_t, int32_t>[n];
for(int32_t i = 0; i < n; i++) {
int32_t x, y;
std::cin >> x >> y;
per_x[x]++;
per_y[y]++;
points[i] = {x, y};
}
int64_t ans = 0;
for(int32_t i = 0; i < n; i++)
ans += (int64_t)(per_x[points[i].first] - 1) * (per_y[points[i].second] - 1);
std::cout << ans;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |