# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
38149 | 2018-01-02T12:05:12 Z | 14kg | Star triangles (IZhO11_triangle) | C++11 | 679 ms | 6552 KB |
#include <stdio.h> #include <map> using namespace std; int n; pair<int, int> in[300001]; map<int, int> X, Y; int main() { long long cnt = 0, t1, t2; scanf("%d", &n); for (int i = 1; i <= n; i++) { scanf("%d %d", &in[i].first, &in[i].second); X[in[i].first]++, Y[in[i].second]++; } for (int i = 1; i <= n; i++) { t1 = X[in[i].first] - 1, t2 = Y[in[i].second] - 1; cnt += t1*t2; } printf("%d", cnt); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 3516 KB | Output is correct |
2 | Correct | 0 ms | 3516 KB | Output is correct |
3 | Correct | 0 ms | 3516 KB | Output is correct |
4 | Correct | 0 ms | 3516 KB | Output is correct |
5 | Correct | 0 ms | 3516 KB | Output is correct |
6 | Correct | 0 ms | 3516 KB | Output is correct |
7 | Correct | 0 ms | 3516 KB | Output is correct |
8 | Correct | 0 ms | 3516 KB | Output is correct |
9 | Correct | 0 ms | 3516 KB | Output is correct |
10 | Correct | 0 ms | 3516 KB | Output is correct |
11 | Correct | 0 ms | 3516 KB | Output is correct |
12 | Correct | 6 ms | 4044 KB | Output is correct |
13 | Correct | 9 ms | 4044 KB | Output is correct |
14 | Correct | 13 ms | 4308 KB | Output is correct |
15 | Correct | 229 ms | 6420 KB | Output is correct |
16 | Correct | 219 ms | 6552 KB | Output is correct |
17 | Correct | 236 ms | 6420 KB | Output is correct |
18 | Correct | 199 ms | 6420 KB | Output is correct |
19 | Correct | 629 ms | 6552 KB | Output is correct |
20 | Correct | 433 ms | 6552 KB | Output is correct |
21 | Correct | 636 ms | 6552 KB | Output is correct |
22 | Correct | 679 ms | 6552 KB | Output is correct |