# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
491433 | levsog2004 | Star triangles (IZhO11_triangle) | C++14 | 104 ms | 13764 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |