# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1133674 | MunkhturErdenebat | Star triangles (IZhO11_triangle) | C++20 | 405 ms | 9228 KiB |
#include<bits/stdc++.h>
#include<string.h>
#include <algorithm>
#include <stdlib.h>
#define fr first
#define sc second
#define ll long long
using namespace std;
ll a,b,c,d,e,f,m,i,j,n,h,g,l,r,ka,p,q,k[500005],t[500005];
map<ll,ll> maa,mii,mee;
vector<ll> vis,vo,vi;
int main(){
cin>>a;
for(i=0 ; i<a ; i++){
cin>>k[i]>>t[i];
maa[k[i]]++;
mee[t[i]]++;
}
h=0;
for(i=0 ; i<a ; i++){
h+=(maa[k[i]]-1)*(mee[t[i]]-1);
}
cout<<h<<endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |