Submission #304156

#TimeUsernameProblemLanguageResultExecution timeMemory
304156_Yo_S_iN_Star triangles (IZhO11_triangle)C++17
100 / 100
971 ms9208 KiB
#include<bits/stdc++.h> #define pb push_back #define ll long long using namespace std; ll n, m, x,cnt , a; void solve(){ map<ll , ll>used , used1; cin >> n; ll arr[n] , b[n]; for( int i = 0;i < n;i ++ ){ cin >> arr[i] >> b[i]; used[arr[i]] ++; used1[b[i]] ++; } for( int i = 0;i < n;i ++ ){ cnt+=(used[arr[i]] - 1) * (used1[b[i]] - 1); } cout << cnt; } int main(){ solve(); }
#Verdict Execution timeMemoryGrader output
Fetching results...