# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
531531 | devariaota | Star triangles (IZhO11_triangle) | C++17 | 2064 ms | 1612 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;
int main(){
cin.tie(0) -> ios_base::sync_with_stdio(0);
int n;
cin >> n;
vector<int> x(n), y(n);
for(int i=0;i<n;i++)
{
cin >> x[i] >> y[i];
}
int ans = 0;
for(int i=0;i<n;i++)
{
int cx = 0, cy = 0;
for(int j=0;j<n;j++)
{
if(x[i] == x[j]) cx++;
if(y[i] == y[j]) cy++;
}
ans += (cx - 1) * (cy - 1);
}
cout << ans << '\n';
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |