# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
17447 | gs14004 | Star triangles (IZhO11_triangle) | C++14 | 456 ms | 7100 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 <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <limits.h>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <string>
#include <functional>
#include <vector>
#include <numeric>
#include <deque>
#include <utility>
#include <bitset>
#include <iostream>
using namespace std;
typedef long long lint;
typedef long double llf;
typedef pair<int, int> pi;
map<int, int> mx, my;
int n;
pi a[300005];
int main(){
scanf("%d",&n);
for(int i=0; i<n; i++){
scanf("%d %d",&a[i].first, &a[i].second);
mx[a[i].first]++;
my[a[i].second]++;
}
lint ret = 0;
for(int i=0; i<n; i++){
ret += 1ll * (mx[a[i].first]-1) * (my[a[i].second]-1);
}
cout << ret;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |