Submission #838649

# Submission time Handle Problem Language Result Execution time Memory
838649 2023-08-27T14:06:29 Z fanwen Star triangles (IZhO11_triangle) C++17
0 / 100
81 ms 6212 KB
/**
 *      author : pham van sam 
 *      created : 27 August 2023 (Sunday)
 **/

#include <bits/stdc++.h>

using namespace std;

const int MAXN = 1e5 + 5;

int N, x[MAXN], y[MAXN];
map <int, int> cnt_x, cnt_y;

void you_make_it(void) {
    cin >> N;
    for (int i = 1; i <= N; ++i) {
    	cin >> x[i] >> y[i];
    	cnt_x[x[i]]++, cnt_y[y[i]]++;
    }
    long long ans = 0;
    for (int i = 1; i <= N; ++i) {
    	ans += 1LL * (cnt_x[x[i]] - 1) * (cnt_y[y[i]] - 1);
    }
    cout << ans;
}

signed main() {

#ifdef LOCAL
    freopen("TASK.inp", "r", stdin);
    freopen("TASK.out", "w", stdout);
#endif
    auto start_time = chrono::steady_clock::now();

    cin.tie(0), cout.tie(0) -> sync_with_stdio(0);

    you_make_it();

    auto end_time = chrono::steady_clock::now();

    cerr << "\nExecution time : " << chrono::duration_cast <chrono::milliseconds> (end_time - start_time).count() << "[ms]" << endl;

    return (0 ^ 0);
}

// Dream it. Wish it. Do it.
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 332 KB Output is correct
3 Correct 0 ms 332 KB Output is correct
4 Correct 0 ms 340 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 1 ms 340 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 1 ms 340 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
11 Correct 1 ms 340 KB Output is correct
12 Correct 5 ms 988 KB Output is correct
13 Correct 5 ms 1076 KB Output is correct
14 Correct 8 ms 1388 KB Output is correct
15 Correct 81 ms 6176 KB Output is correct
16 Incorrect 52 ms 6212 KB Output isn't correct
17 Halted 0 ms 0 KB -