제출 #1291080

#제출 시각아이디문제언어결과실행 시간메모리
1291080Gadir_2880별들과 삼각형 (IZhO11_triangle)C++20
0 / 100
1 ms572 KiB
//The Rumbling starts here: #pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math") //#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt") #include<bits/stdc++.h> #define debug(n,m) cout<<"["<<#n<<"]->"<<n<<m #define int long long #define all(x) x.begin(),x.end() #define ai array<int,2> #define vv vector #define pb push_back using namespace std; const int N=3132352; const int mod=1e9+7; const int inf=(1ll<<55)-1; int x[N],y[N]; void levi() { //#define tests int n; cin>>n; map<int,int> mpx; map<int,int> mpy; for (int i=1;i<=n;i++) { cin>>x[i]>>y[i]; mpx[y[i]]++; mpy[x[i]]++; } int res=0; for (int i=1;i<=n;i++) { int k1=mpx[x[i]]-1; int k2=mpy[y[i]]-1; // debug(k1,' '); // debug(k2,'\n'); res+=k1*k2; } cout<<res<<'\n'; } int32_t main() { //freopen("input.in","r",stdin); ios_base::sync_with_stdio(0); cin.tie(0); int tt=1; #ifdef tests cin>>tt; #endif while(tt--) levi(); }
#Verdict Execution timeMemoryGrader output
Fetching results...