# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
93819 | Noam527 | Star triangles (IZhO11_triangle) | C++17 | 445 ms | 12408 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>
#define CHECK cout << "ok" << endl
#define finish(x) return cout << x << endl, 0
typedef long long ll;
typedef long double ldb;
const int md = 1e9 + 7, inf = 1e9 + 7;
using namespace std;
void debug(string names) {
cout << '\n';
}
template<typename A1, typename... A2>
void debug(string names, A1 par, A2... left) {
int pos = 0;
for (; pos < names.size() && names[pos] != ' ' && names[pos] != ','; pos++)
cout << names[pos];
cout << ": " << par << " ";
while (pos < names.size() && (names[pos] == ' ' || names[pos] == ',')) {
pos++;
}
names.erase(names.begin(), names.begin() + pos);
debug(names, left...);
}
int n;
vector<pair<int, int>> a;
map<int, int> x, y;
ll ans = 0;
int main() {
ios::sync_with_stdio(0), cin.tie(0);
cin >> n;
a.resize(n);
for (auto &i : a) cin >> i.first >> i.second, x[i.first]++, y[i.second]++;
for (auto &i : a) ans += (ll)(x[i.first] - 1) * (y[i.second] - 1);
finish(ans);
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |