Submission #593296

#TimeUsernameProblemLanguageResultExecution timeMemory
593296SummersStar triangles (IZhO11_triangle)C++14
100 / 100
113 ms14148 KiB
#include<bits/stdc++.h> #include<unordered_map> #define endl '\n' using namespace std; long long a[1000000], b[1000000]; unordered_map<long long,long long>mp,mp2; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); long long i,j,k,br=0,n; cin>>n; for(i=0;i<n;i++) { cin>>a[i]>>b[i]; mp[a[i]]++; mp2[b[i]]++; } for(i=0;i<n;i++) { br+=(mp[a[i]]-1)*(mp2[b[i]]-1); } cout<<br<<endl; }

Compilation message (stderr)

triangle.cpp: In function 'int main()':
triangle.cpp:13:17: warning: unused variable 'j' [-Wunused-variable]
   13 |     long long i,j,k,br=0,n;
      |                 ^
triangle.cpp:13:19: warning: unused variable 'k' [-Wunused-variable]
   13 |     long long i,j,k,br=0,n;
      |                   ^
#Verdict Execution timeMemoryGrader output
Fetching results...