# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
971245 | Aika | Star triangles (IZhO11_triangle) | C++14 | 262 ms | 14604 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 int long long
#define aiiiii ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
using namespace std;
signed main(){
aiiiii
int n, i, j;
cin>>n;
int ans1=0,ans2=0;
map<int,int>mp;
map<int,int>mp1;
int r[n],s[n];
for(i=0;i<n;i++){
cin>>r[i]>>s[i];
mp[r[i]]++;
mp1[s[i]]++;
}
int ans=0;
for(i=0;i<n;i++){
ans+=(mp[r[i]]-1)*(mp1[s[i]]-1);
}
cout<<ans;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |