Submission #593297

#TimeUsernameProblemLanguageResultExecution timeMemory
593297daisy2Star triangles (IZhO11_triangle)C++14
100 / 100
352 ms5304 KiB
#include<iostream> #include<algorithm> #include<unordered_map> using namespace std; int n,x[300005],y[300005]; unordered_map <long long,long long> row,col; int main() { cin>>n; for(int i=0;i<n;i++) { cin>>x[i]>>y[i]; if(!col.count(x[i])) col[x[i]]=0; if(!row.count(y[i])) row[y[i]]=0; col[x[i]]++; row[y[i]]++; } long long br=0; for(int i=0;i<n;i++) { br+=(row[y[i]]-1)*(col[x[i]]-1); } cout<<br<<endl; }

Compilation message (stderr)

triangle.cpp: In function 'int main()':
triangle.cpp:14:8: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   14 |        if(!col.count(x[i]))
      |        ^~
triangle.cpp:17:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   17 |         if(!row.count(y[i]))
      |         ^~
#Verdict Execution timeMemoryGrader output
Fetching results...