Submission #37257

#TimeUsernameProblemLanguageResultExecution timeMemory
37257Yusup01Star triangles (IZhO11_triangle)C++14
0 / 100
0 ms6868 KiB
#include<bits/stdc++.h> using namespace std; long long x[300009],y[300009],jog; int n; map<long long,int> X,Y; int main() { ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); freopen("triangle.in","r",stdin); freopen("triangle.out","w",stdout); cin>>n; for(int i=1;i<=n;i++){cin>>x[i]>>y[i]; X[x[i]]++; Y[y[i]]++;} for(int i=1;i<=n;i++) { jog+=(X[x[i]]-1)*(Y[y[i]]-1); } cout<<jog; }

Compilation message (stderr)

triangle.cpp: In function 'int main()':
triangle.cpp:9:34: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
  freopen("triangle.in","r",stdin);
                                  ^
triangle.cpp:10:36: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
  freopen("triangle.out","w",stdout);
                                    ^
#Verdict Execution timeMemoryGrader output
Fetching results...