# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
87934 | 2018-12-03T09:12:56 Z | turbat | Star triangles (IZhO11_triangle) | C++14 | 2 ms | 256 KB |
/* ID: turbat_1 TASK: sort3 LANG: C++ */ #include <bits/stdc++.h> using namespace std; #define F first #define S second int n; long long ans; pair <int, int> p[300005]; map <int, int> my, mx; int main (){ freopen("input", "r", stdin); freopen("output", "w", stdout); cin >> n; for (int i = 0;i < n;i++){ cin >> p[i].F>> p[i].S; mx[p[i].F]++; my[p[i].S]++; } for (int i = 0;i < n;i++) ans += (mx[p[i].F] - 1) * (my[p[i].S] - 1); cout << ans<<endl; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 256 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |