Submission #476228

#TimeUsernameProblemLanguageResultExecution timeMemory
476228kkkStar triangles (IZhO11_triangle)C++14
100 / 100
146 ms14176 KiB
#include<unordered_map> #include<iostream> #define endl '\n' using namespace std; long long x[10000000], y[10000000], n, m; unordered_map<long long, long long>a, b; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); long long i,j, br=0; cin>>n; for(i=0;i<n;i++) { cin>>x[i]>>y[i]; a[x[i]]++; b[y[i]]++; } for(i=0;i<n;i++) { br+=(a[x[i]]-1)*(b[y[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, br=0;
      |                 ^
#Verdict Execution timeMemoryGrader output
Fetching results...