Submission #521900

#TimeUsernameProblemLanguageResultExecution timeMemory
521900Ronin13Star triangles (IZhO11_triangle)C++14
100 / 100
305 ms13340 KiB
#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 timeMemoryGrader output
Fetching results...