# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
977008 | vjudge1 | Star triangles (IZhO11_triangle) | C++17 | 1270 ms | 48464 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;
#define ll long long
#define fs first
#define sc second
int main(){
int n;
cin>>n;
multiset<pair<int,int>> p;
multiset<int> mx,my;
while (n--) {
int x,y;
cin>>x>>y;
p.insert({x,y});
mx.insert(x);my.insert(y);
}
ll cnt=0;
for (auto [x,y]:p){
ll a=mx.count(x)-p.count({x,y}),b=my.count(y)-p.count({x,y});
cnt+=a*b;
}
cout<<cnt;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |