# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
977200 | suhu88 | Star triangles (IZhO11_triangle) | C++14 | 2059 ms | 6740 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];
int main(){
suhu
cin>>n;
for(int i=1;i<=n;i++){
cin>>a[i]>>b[i];
}
ll ans=0;
for(int i=1;i<=n;i++){
ll x=0,y=0;
for(int j=1;j<=n;j++){
if(j==i)continue;
if(a[i]==a[j])x++;
if(b[i]==b[j])y++;
}
ans+=x*y;
}
cout<<ans<<"\n";
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |