Submission #976876

# Submission time Handle Problem Language Result Execution time Memory
976876 2024-05-07T08:19:43 Z vjudge1 Star triangles (IZhO11_triangle) C++17
0 / 100
1 ms 600 KB
#include<bits/stdc++.h>
using namespace std;
#define int long long

signed main(){
    int n;
    cin >> n;

    map<int, int> cx, cy;
    int x[n+1], y[n+1];
    for(int i = 0; i < n; i++){
        cin >> x[i] >> y[i];

        cx[x[i]]++;
        cy[y[i]]++;
    }

    int ans = 0;
    for(int i = 0; i < n; i++){
        ans += (cx[x[i]] - 1) * (cx[y[i]] - 1);
    }

    cout << ans << endl;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 600 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Incorrect 0 ms 348 KB Output isn't correct
5 Halted 0 ms 0 KB -