# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
945399 | NourWael | Star triangles (IZhO11_triangle) | C++17 | 256 ms | 15768 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/extc++.h>
#define int long long
using namespace std;
using namespace __gnu_pbds;
map<int,int> x,y;
signed main() {
ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL);
int n; cin>>n;
pair<int,int> p [n];
for(int i=0; i<n; i++) {
cin>>p[i].first>>p[i].second;
x[p[i].first]++, y[p[i].second]++;;
}
int ans = 0;
for(int i=0; i<n; i++) {
ans += (x[p[i].first]-1) * (y[p[i].second]-1);
}
cout<<ans;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |