# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
977208 | vjudge1 | Star triangles (IZhO11_triangle) | C++17 | 257 ms | 9240 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>
#define suhu ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define fi first
#define se second
#define pb push_back
using namespace std;
typedef long long ll;
const ll MAXN=3e5+5;
const ll inf=1e18;
ll n,a[MAXN],b[MAXN];
map<ll,ll>x;
map<ll,ll>y;
int main(){
suhu
cin>>n;
for(int i=1;i<=n;i++){
cin>>a[i]>>b[i];
x[a[i]]++;
y[b[i]]++;
}
ll ans=0;
for(int i=1;i<=n;i++){
ans+=(x[a[i]]-1)*(y[b[i]]-1);
}
cout<<ans<<"\n";
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |