Submission #412675

#TimeUsernameProblemLanguageResultExecution timeMemory
412675tempusStar triangles (IZhO11_triangle)C++17
0 / 100
3 ms332 KiB
#include <bits/stdc++.h> #define ll long long #define endl "\n" #define ios ios_base::sync_with_stdio(0); cout.tie(0); cin.tie(0); using namespace std; int main() { ios freopen("triangles.out", "w", stdout); freopen("triangles.in", "r", stdin); int n; cin >> n; ll x[n], y[n]; map <ll, ll> m1, m2; for (int i = 0; i < n; ++ i) { cin >> x[i] >> y[i]; m1[x[i]] ++; m2[y[i]] ++; } ll ans = 0; for (int i = 0; i < n; ++ i) { ans += (m1[x[i]] - 1) * (m2[y[i]] - 1); } cout << ans; return 0; }

Compilation message (stderr)

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