Submission #975093

#TimeUsernameProblemLanguageResultExecution timeMemory
975093AmaarsaaStar triangles (IZhO11_triangle)C++14
100 / 100
247 ms15028 KiB
#include<bits/stdc++.h> using namespace std; using ll = long long ; map < int,int > X, Y; int main() { // freopen("moocast.in", "r", stdin); // freopen("moocast.out", "w", stdout); ios::sync_with_stdio(false); cin.tie(NULL); ll t, n, m, ans, s, sum, r, p, i, j; cin >> n; ll x[n + 2], y[n + 2]; for (i = 1; i <= n; i ++) { cin >> x[i] >> y[i]; X[x[i]] ++; Y[y[i]] ++; } ans = 0; for (i = 1; i <= n; i ++) { s = (X[x[i]] - 1) * (Y[y[i]] - 1); ans += s; } cout << ans << endl; }

Compilation message (stderr)

triangle.cpp: In function 'int main()':
triangle.cpp:11:5: warning: unused variable 't' [-Wunused-variable]
   11 |  ll t, n, m, ans, s, sum, r, p, i, j;
      |     ^
triangle.cpp:11:11: warning: unused variable 'm' [-Wunused-variable]
   11 |  ll t, n, m, ans, s, sum, r, p, i, j;
      |           ^
triangle.cpp:11:22: warning: unused variable 'sum' [-Wunused-variable]
   11 |  ll t, n, m, ans, s, sum, r, p, i, j;
      |                      ^~~
triangle.cpp:11:27: warning: unused variable 'r' [-Wunused-variable]
   11 |  ll t, n, m, ans, s, sum, r, p, i, j;
      |                           ^
triangle.cpp:11:30: warning: unused variable 'p' [-Wunused-variable]
   11 |  ll t, n, m, ans, s, sum, r, p, i, j;
      |                              ^
triangle.cpp:11:36: warning: unused variable 'j' [-Wunused-variable]
   11 |  ll t, n, m, ans, s, sum, r, p, i, j;
      |                                    ^
#Verdict Execution timeMemoryGrader output
Fetching results...