Submission #884620

# Submission time Handle Problem Language Result Execution time Memory
884620 2023-12-07T18:33:03 Z Andrey Star triangles (IZhO11_triangle) C++14
0 / 100
0 ms 348 KB
#include <bits/stdc++.h>
using namespace std;

map<long long,long long> bruh;
map<long long,long long> idk;
map<pair<long long,long long>,long long> yay;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    long long n,a,b,ans = 0;
    cin >> n;
    vector<pair<long long,long long>> haha(n);
    for(long long i = 0; i < n; i++) {
        cin >> a >> b;
        haha[i] = {a,b};
        yay[{a,b}]++;
        bruh[a]++;
        idk[a]++;
    }
    for(long long i = 0; i < n; i++) {
        a = haha[i].first;
        b = haha[i].second;
        long long c = yay[{a,b}];
        ans+=(bruh[a]-c)*(idk[b]-c);
    }
    cout << ans;
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 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 -