Submission #491433

#TimeUsernameProblemLanguageResultExecution timeMemory
491433levsog2004Star triangles (IZhO11_triangle)C++14
0 / 100
104 ms13764 KiB
#include <iostream> #include <fstream> #include <algorithm> #include <cstring> #include <string> #include <vector> #include <cstdio> #include <queue> #include <deque> #include <stack> #include <cmath> #include <list> #include <set> #include <map> using namespace std; typedef long long ll; const long long N = 100005; ll n, m, i, j, k, u, v, x, y, z, pat,d,e; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); map <ll, ll> x, y; pair <ll, ll> a[N]; cin >> n; for (i = 0; i < n; i++) { cin >> a[i].first>>a[i].second; x[a[i].second]++; y[a[i].first]++; } for (i = 0; i < n; i++) { pat += (x[a[i].second]-1 )* (y[a[i].first]-1); } cout << pat << endl; //system("pause"); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...