Submission #971245

#TimeUsernameProblemLanguageResultExecution timeMemory
971245AikaStar triangles (IZhO11_triangle)C++14
100 / 100
262 ms14604 KiB
#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)

triangle.cpp: In function 'int main()':
triangle.cpp:8:15: warning: unused variable 'j' [-Wunused-variable]
    8 |     int n, i, j;
      |               ^
triangle.cpp:10:9: warning: unused variable 'ans1' [-Wunused-variable]
   10 |     int ans1=0,ans2=0;
      |         ^~~~
triangle.cpp:10:16: warning: unused variable 'ans2' [-Wunused-variable]
   10 |     int ans1=0,ans2=0;
      |                ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...