# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
968570 | vjudge1 | Star triangles (IZhO11_triangle) | C++17 | 242 ms | 12112 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;
const int MAXN = 3e5;
int N;
int X[MAXN + 5], Y[MAXN + 5];
map<int, int> cntX, cntY;
int main() {
ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
cin >> N;
for (int i = 0; i < N; i++) {
cin >> X[i] >> Y[i];
cntX[X[i]]++;
cntY[Y[i]]++;
}
long long ans = 0;
for (int i = 0; i < N; i++) {
ans += 1ll * (cntX[X[i]] - 1) * (cntY[Y[i]] - 1);
}
cout << ans << endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |