# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
521900 | Ronin13 | Star triangles (IZhO11_triangle) | C++14 | 305 ms | 13340 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 ll long long
#define ull unsigned ll
#define pb push_back
#define epb emplace_back
#define f first
#define s second
#define pii pair<int,int>
#define pll pair<ll,ll>
#define inf 1e9+1
#define linf 1e18+1
using namespace std;
int dp[100001][101];
map<ll,ll>usedx,usedy;
int main(){
ios_base::sync_with_stdio(false);cin.tie(0);
int n;cin>>n;
int x[n+1],y[n+1];
for(int i=1;i<=n;i++)cin>>x[i]>>y[i];
for(int i=1;i<=n;i++){
usedx[x[i]]++;
usedy[y[i]]++;
}
ll ans=0;
for(int i=1;i<=n;i++){
ans+=(usedx[x[i]]-1)*(usedy[y[i]]-1);
}
cout<<ans;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |