Language: C++

#include <bits/stdc++.h>
using namespace std;

int n;
int x[105], y[105];
int x1, x2, x3, x4;
int y1, y2, y3, y4;
int c10, c11, c20, c21, c30, c31, c40, c41;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i)
    scanf("%d%d", x + i, y + i);
  for (int i = 1; i <= n; ++i) {
    if (x[i] >= 0) {
      x1 += x[i];
      if (x[i] > 0) {
        y1 += y[i];
      }
      else {
        if (y[i] < 0) c10 += y[i];
        if (y[i] > 0) c11 += y[i];
      }
    }
    if (x[i] <= 0) {
      x2 += x[i];
      if (x[i] < 0) {
        y2 += y[i];
      }
      else {
        if (y[i] < 0) c20 += y[i];
        if (y[i] > 0) c21 += y[i];
      }
    }
    if (y[i] >= 0) {
      y3 += y[i];
      if (y[i] > 0) {
        x3 += x[i];
      }
      else {
        if (x[i] < 0) c30 += x[i];
        if (x[i] > 0) c31 += x[i];
      }
    }
    if (y[i] <= 0) {
      y4 += y[i];
      if (y[i] < 0) {
        x4 += x[i];
      }
      else {
        if (x[i] < 0) c40 += x[i];
        if (x[i] > 0) c41 += x[i];
      }
    }
  }
  if (y1 < 0) y1 += c10;
  else y1 += c11;
  if (y2 < 0) y2 += c20;
  else y2 += c21;
  if (x3 < 0) x3 += c30;
  else x3 += c31;
  if (x4 < 0) x4 += c40;
  else x4 += c41;
  double d1 = sqrt(1LL * x1 * x1 + 1LL * y1 * y1);
  double d2 = sqrt(1LL * x2 * x2 + 1LL * y2 * y2);
  double d3 = sqrt(1LL * x3 * x3 + 1LL * y3 * y3);
  double d4 = sqrt(1LL * x4 * x4 + 1LL * y4 * y4);
  printf("%.12f\n", max({d1, d2, d3, d4}));
  return 0;
}


Compiler output:
a.cc:7:5: error: 'int y1' redeclared as different kind of entity
    7 | int y1, y2, y3, y4;
      |     ^~
In file included from /usr/include/features.h:523,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:683,
                 from /usr/include/c++/14/cassert:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:33,
                 from a.cc:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:257:1: note: previous declaration 'double y1(double)'
  257 | __MATHCALL (y1,, (_Mdouble_));
      | ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:17:12: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   17 |         y1 += y[i];
      |         ~~~^~~~~~~
a.cc:17:12: error: assignment of read-only location 'y1'
a.cc:55:10: error: ordered comparison of pointer with integer zero ('double (*)(double) noexcept' and 'int')
   55 |   if (y1 < 0) y1 += c10;
      |       ~~~^~~
a.cc:55:18: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   55 |   if (y1 < 0) y1 += c10;
      |               ~~~^~~~~~
a.cc:55:18: error: assignment of read-only location 'y1'
a.cc:56:11: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   56 |   else y1 += c11;
      |        ~~~^~~~~~
a.cc:56:11: error: assignment of read-only location 'y1'
a.cc:63:40: error: invalid operands of types 'long long int' and 'double(double) noexcept' to binary 'operator*'
   63 |   double d1 = sqrt(1LL * x1 * x1 + 1LL * y1 * y1);
      |                                    ~~~ ^ ~~
      |                                    |     |
      |                                    |     double(double) noexcept
      |                                    long long int