Submission #17681

# Submission time Handle Problem Language Result Execution time Memory
17681 2016-01-12T07:05:24 Z Elibay Star triangles (IZhO11_triangle) C++14
0 / 100
0 ms 4060 KB
#include <bits/stdc++.h>
#define Fname "triangles"

using namespace std;

const int MaxN = 3e5 + 17, INF = 1e9 + 17, Mod = 1e9 + 7;

map < int, int > mx;
map < int, int > my;

int x[MaxN], y[MaxN], n;
long long Sum;
int main ()
{
    #ifdef Elibay
        freopen (".in", "r", stdin);
    #else
        freopen (Fname".in", "r", stdin);
        freopen (Fname".out", "w", stdout);
    #endif
    scanf ("%d", &n);
    for (int i = 1; i <= n; ++ i)
        scanf ("%d%d", &x[i], &y[i]), mx[x[i]] ++, my[y[i]] ++;
    for (int i = 1; i <= n; ++ i)
        Sum += (mx[x[i]] - 1) * (my[y[i]] - 1);
    printf ("%lld", Sum);
    return 0;
}
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 4060 KB open (syscall #2) was called by the program (disallowed syscall)
2 Runtime error 0 ms 4060 KB open (syscall #2) was called by the program (disallowed syscall)
3 Runtime error 0 ms 4060 KB open (syscall #2) was called by the program (disallowed syscall)
4 Runtime error 0 ms 4060 KB open (syscall #2) was called by the program (disallowed syscall)
5 Runtime error 0 ms 4060 KB open (syscall #2) was called by the program (disallowed syscall)
6 Runtime error 0 ms 4060 KB open (syscall #2) was called by the program (disallowed syscall)
7 Runtime error 0 ms 4060 KB open (syscall #2) was called by the program (disallowed syscall)
8 Runtime error 0 ms 4060 KB open (syscall #2) was called by the program (disallowed syscall)
9 Runtime error 0 ms 4060 KB open (syscall #2) was called by the program (disallowed syscall)
10 Runtime error 0 ms 4060 KB open (syscall #2) was called by the program (disallowed syscall)
11 Runtime error 0 ms 4060 KB open (syscall #2) was called by the program (disallowed syscall)
12 Runtime error 0 ms 4060 KB open (syscall #2) was called by the program (disallowed syscall)
13 Runtime error 0 ms 4060 KB open (syscall #2) was called by the program (disallowed syscall)
14 Runtime error 0 ms 4060 KB open (syscall #2) was called by the program (disallowed syscall)
15 Runtime error 0 ms 4060 KB open (syscall #2) was called by the program (disallowed syscall)
16 Runtime error 0 ms 4060 KB open (syscall #2) was called by the program (disallowed syscall)
17 Runtime error 0 ms 4060 KB open (syscall #2) was called by the program (disallowed syscall)
18 Runtime error 0 ms 4060 KB open (syscall #2) was called by the program (disallowed syscall)
19 Runtime error 0 ms 4060 KB open (syscall #2) was called by the program (disallowed syscall)
20 Runtime error 0 ms 4060 KB open (syscall #2) was called by the program (disallowed syscall)
21 Runtime error 0 ms 4060 KB open (syscall #2) was called by the program (disallowed syscall)
22 Runtime error 0 ms 4060 KB open (syscall #2) was called by the program (disallowed syscall)