Submission #888251

# Submission time Handle Problem Language Result Execution time Memory
888251 2023-12-16T16:37:56 Z kokoue Star triangles (IZhO11_triangle) C++14
0 / 100
1 ms 2656 KB
#include<bits/stdc++.h>
using namespace std;
struct point
{
    int x,y;
};
point p[300000];
int x[100000],y[100000];
int n;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cin>>n;
    for(int i=0;i<n;i++)
    {
        cin>>p[i].x>>p[i].y;
        x[p[i].x]++;
        y[p[i].y]++;
    }
    int ans=0;
    for(int i=0;i<n;i++)
    {
        ans+=(x[p[i].x]-1)*(y[p[i].y]-1);
    }
    cout<<ans<<"\n";
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2396 KB Output is correct
2 Correct 1 ms 2396 KB Output is correct
3 Correct 1 ms 2392 KB Output is correct
4 Correct 1 ms 2656 KB Output is correct
5 Incorrect 1 ms 2396 KB Output isn't correct
6 Halted 0 ms 0 KB -