# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
975151 | vjudge1 | Star triangles (IZhO11_triangle) | C++17 | 391 ms | 14320 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+7;
int main(){
int q; cin >> q;
long long x[maxN], y[maxN];
map<int, int> cntX, cntY;
for(int i = 0; i < q; i++)
{
cin >> x[i] >> y[i];
cntX[x[i]]++;
cntY[y[i]]++;
}
long long ans = 0;
for(int i = 0; i < q; i++){
ans += (cntX[x[i]] - 1) * (cntY[y[i]] - 1);
}
cout << ans << endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |