# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
41333 | IvanC | Star triangles (IZhO11_triangle) | C++14 | 521 ms | 42360 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 <bits/stdc++.h>
using namespace std;
const int MAXN = 3*1e5 + 10;
typedef long long ll;
ll N,ans,c1[MAXN],c2[MAXN];
map<ll,ll> X,Y;
int main(){
cin.tie(0);ios_base::sync_with_stdio(0);
cin >> N;
for(int i = 1;i<=N;i++){
cin >> c1[i] >> c2[i];
X[c1[i]]++;
Y[c2[i]]++;
}
for(int i = 1;i<=N;i++){
ans += (X[c1[i]] - 1)*(Y[c2[i]] - 1);
}
cout << ans << endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |