Submission #707026

#TimeUsernameProblemLanguageResultExecution timeMemory
707026ToroTNStar triangles (IZhO11_triangle)C++14
0 / 100
111 ms7456 KiB
#include<bits/stdc++.h> using namespace std; #define ll long long ll n,x[300005],y[30005],cnt=0; map<ll,ll> mp1,mp2; int main() { scanf("%lld",&n); for(int i=1;i<=n;i++) { scanf("%lld%lld",&x[i],&y[i]); ++mp1[x[i]],++mp2[y[i]]; } for(int i=1;i<=n;i++) { cnt+=(mp1[x[i]]-1)*(mp2[y[i]]-1); } printf("%lld\n",cnt); }

Compilation message (stderr)

triangle.cpp: In function 'int main()':
triangle.cpp:8:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    8 |     scanf("%lld",&n);
      |     ~~~~~^~~~~~~~~~~
triangle.cpp:11:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   11 |         scanf("%lld%lld",&x[i],&y[i]);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...