답안 #1018638

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1018638 2024-07-10T07:45:07 Z Muaath_5 Islands (IOI08_islands) C++17
컴파일 오류
0 ms 0 KB
#pragma GCC optimize("Oz")
#include <bits/stdc++.h>
#define ll long long
#define pii pair<int, int>
using namespace std;

const int N = 1e6+5;

// input
int n;
vector<pair<int, int>> adj[N]; // 8M
map<pii, int> edge; // count duplicate // 12M
map<pii, int> we; // weight of edge // 12M

// dfs
vector<bool> vis(N); // 1M or less
vector<int> stck; // 1M
vector<int> cyc; // 1M

// diameter dfs
pii remedge;
int blk[2];
int mx[N]; // 1M

ll a[N]; // 8M

//ll pref[N]; // 8M
//ll mxdep[N]; // 8M

void dfs(int node, int par=0) {
  vis[node] = 1;
  stck.push_back(node);
  for (auto &[ch, cost] : adj[node]) {
    if (!vis[ch])
      dfs(ch, node);
    else if (!cyc.size() && edge[{node, ch}] == 2) {
      cyc.push_back(node);
      cyc.push_back(ch);
    }
    else if (!cyc.size() && vis[ch] && ch != par) {
      bool st = 0;
      for (int cur : stck) {
        if (cur == ch) st = 1;
        if (st) cyc.push_back(cur);
      }
    }

  }
  stck.pop_back();
}


ll farthest_dp(int node, int par=0) {
  mx[node] = node;
  ll mxdep = 0;
  for (auto [ch, cost] : adj[node]) {
    if (blk[0] == ch || blk[1] == ch || ch == par) continue;
    if (make_pair(node, ch) != remedge && make_pair(ch, node) != remedge) {
      ll mxdepch = farthest_dp(ch, node);
      if (mxdepch + cost > mxdep) {
        mxdep = mxdepch + cost;
        mx[node] = mx[ch];
      }
    }
  }
  return mxdep;
}

ll solve_for(int node)
{
  cyc.clear();
  dfs(node);
  const ll L = cyc.size();
  //assert(L > 1);
  // cerr << "#" << node << ": ";	
  // cerr << L << ": ";
  // for(int i:cyc)cerr<<i<<' ';
  // cerr<<"| ";



  // remove an edge from the cycle and find diameter
  if (L > 2)
    remedge = {cyc[0], cyc[1]};
  else
    remedge = {-1, -1};
  farthest_dp(node);
  int fr = mx[node];
  ll diam = farthest_dp(fr);



  // a[i] = max depth of tree going from i not in cycle direction 
  // prefix sums
  for (int i = 0; i < L; i++) {
    blk[0] = cyc[(i+1)%L];
    blk[1] = cyc[(i-1+L)%L];
    a[i] = farthest_dp(cyc[i]);
  }


  // for (int i = 0; i < L; i++)
  // cerr << a[i] << ' ';
  // cerr << "| ";

  // cost of path(i,j) = a[i] + a[j] + (p[i] - p[j]);
  // maintain maximum a[j] - p[j], and the answer for suffix i:
  // 	
  ll prvmx = 0, prvmx2 = 0;;
  ll sol = 0;
  ll pref = 0;
  for (int i = 1; i < L; i++)
    pref += we[{cyc[i], cyc[i-1]}];

  const ll LL = pref + we[{cyc[L-1], cyc[0]}];
  if (L == 2) {
    sol = *max_element(a, a+L) + we[{cyc[0], cyc[1]}];
    goto RET;
  }

  pref = 0;
  prvmx = prvmx2 = a[0];
  for (int i = 1; i < L; i++) {
    pref += we[{cyc[i], cyc[i-1]}];
    sol = max(sol, a[i] + pref + prvmx);
    sol = max(sol, LL + a[i] - pref + prvmx2);
    prvmx2 = max(prvmx2, a[i] + pref);
    prvmx = max(prvmx, a[i] - pref);
  }

  RET:
  return max(diam, sol);
}


signed main()
{
  ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
  // stck.reserve(N/2);
  // cyc.reserve(N/2);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    int u, w;
    cin >> u >> w;
    adj[i].push_back({u, w});
    adj[u].push_back({i, w});
    edge[{i,u}]++, edge[{u,i}]++;
    we[{i, u}] = we[{u, i}] = max(we[{i, u}], w);
  }
  ll sum = 0;
  for (int i = 1; i <= n; i++)
    if (!vis[i])
      sum += solve_for(i);
  cout << sum;
}

Compilation message

islands.cpp:1:26: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
    1 | #pragma GCC optimize("Oz")
      |                          ^
In file included from /usr/include/c++/10/cassert:44,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:33,
                 from islands.cpp:2:
/usr/include/assert.h:71:43: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
   71 |      __THROW __attribute__ ((__noreturn__));
      |                                           ^
/usr/include/assert.h:71:43: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
/usr/include/assert.h:76:43: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
   76 |      __THROW __attribute__ ((__noreturn__));
      |                                           ^
/usr/include/assert.h:76:43: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
/usr/include/assert.h:82:43: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
   82 |      __THROW __attribute__ ((__noreturn__));
      |                                           ^
/usr/include/assert.h:82:43: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
In file included from /usr/include/c++/10/cctype:42,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:35,
                 from islands.cpp:2:
/usr/include/ctype.h:80:40: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
   80 |      __THROW __attribute__ ((__const__));
      |                                        ^
/usr/include/ctype.h:80:40: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
/usr/include/ctype.h:82:40: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
   82 |      __THROW __attribute__ ((__const__));
      |                                        ^
/usr/include/ctype.h:82:40: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
/usr/include/ctype.h:84:40: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
   84 |      __THROW __attribute__ ((__const__));
      |                                        ^
/usr/include/ctype.h:84:40: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
In file included from /usr/include/features.h:461,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/os_defines.h:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/c++config.h:518,
                 from /usr/include/c++/10/cassert:43,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:33,
                 from islands.cpp:2:
/usr/include/ctype.h:108:1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  108 | __exctype (isalnum);
      | ^~~~~~~~~
/usr/include/ctype.h:108:1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
/usr/include/ctype.h:109:1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  109 | __exctype (isalpha);
      | ^~~~~~~~~
/usr/include/ctype.h:109:1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
/usr/include/ctype.h:110:1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  110 | __exctype (iscntrl);
      | ^~~~~~~~~
/usr/include/ctype.h:110:1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
/usr/include/ctype.h:111:1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  111 | __exctype (isdigit);
      | ^~~~~~~~~
/usr/include/ctype.h:111:1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
/usr/include/ctype.h:112:1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  112 | __exctype (islower);
      | ^~~~~~~~~
/usr/include/ctype.h:112:1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
/usr/include/ctype.h:113:1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  113 | __exctype (isgraph);
      | ^~~~~~~~~
/usr/include/ctype.h:113:1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
/usr/include/ctype.h:114:1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  114 | __exctype (isprint);
      | ^~~~~~~~~
/usr/include/ctype.h:114:1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
/usr/include/ctype.h:115:1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  115 | __exctype (ispunct);
      | ^~~~~~~~~
/usr/include/ctype.h:115:1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
/usr/include/ctype.h:116:1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  116 | __exctype (isspace);
      | ^~~~~~~~~
/usr/include/ctype.h:116:1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
/usr/include/ctype.h:117:1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  117 | __exctype (isupper);
      | ^~~~~~~~~
/usr/include/ctype.h:117:1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
/usr/include/ctype.h:118:1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  118 | __exctype (isxdigit);
      | ^~~~~~~~~
/usr/include/ctype.h:118:1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
/usr/include/ctype.h:122:30: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  122 | extern int tolower (int __c) __THROW;
      |                              ^~~~~~~
/usr/include/ctype.h:122:30: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
/usr/include/ctype.h:125:30: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  125 | extern int toupper (int __c) __THROW;
      |                              ^~~~~~~
/usr/include/ctype.h:125:30: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
/usr/include/ctype.h:130:1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  130 | __exctype (isblank);
      | ^~~~~~~~~
/usr/include/ctype.h:130:1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
/usr/include/ctype.h:135:42: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  135 | extern int isctype (int __c, int __mask) __THROW;
      |                                          ^~~~~~~
/usr/include/ctype.h:135:42: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
/usr/include/ctype.h:142:30: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  142 | extern int isascii (int __c) __THROW;
      |                              ^~~~~~~
/usr/include/ctype.h:142:30: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
/usr/include/ctype.h:146:30: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  146 | extern int toascii (int __c) __THROW;
      |                              ^~~~~~~
/usr/include/ctype.h:146:30: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
/usr/include/ctype.h:150:1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  150 | __exctype (_toupper);
      | ^~~~~~~~~
/usr/include/ctype.h:150:1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
/usr/include/ctype.h:151:1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  151 | __exctype (_tolower);
      | ^~~~~~~~~
/usr/include/ctype.h:151:1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
/usr/include/ctype.h:251:1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  251 | __exctype_l (isalnum_l);
      | ^~~~~~~~~~~
/usr/include/ctype.h:251:1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
/usr/include/ctype.h:252:1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  252 | __exctype_l (isalpha_l);
      | ^~~~~~~~~~~
/usr/include/ctype.h:252:1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
/usr/include/ctype.h:253:1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  253 | __exctype_l (iscntrl_l);
      | ^~~~~~~~~~~
/usr/include/ctype.h:253:1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
/usr/include/ctype.h:254:1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  254 | __exctype_l (isdigit_l);
      | ^~~~~~~~~~~
/usr/include/ctype.h:254:1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
/usr/include/ctype.h:255:1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  255 | __exctype_l (islower_l);
      | ^~~~~~~~~~~
/usr/include/ctype.h:255:1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
/usr/include/ctype.h:256:1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  256 | __exctype_l (isgraph_l);
      | ^~~~~~~~~~~
/usr/include/ctype.h:256:1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
/usr/include/ctype.h:257:1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  257 | __exctype_l (isprint_l);
      | ^~~~~~~~~~~
/usr/include/ctype.h:257:1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
/usr/include/ctype.h:258:1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  258 | __exctype_l (ispunct_l);
      | ^~~~~~~~~~~
/usr/include/ctype.h:258:1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
/usr/include/ctype.h:259:1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  259 | __exctype_l (isspace_l);
      | ^~~~~~~~~~~
/usr/include/ctype.h:259:1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
/usr/include/ctype.h:260:1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  260 | __exctype_l (isupper_l);
      | ^~~~~~~~~~~
/usr/include/ctype.h:260:1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
/usr/include/ctype.h:261:1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  261 | __exctype_l (isxdigit_l);
      | ^~~~~~~~~~~
/usr/include/ctype.h:261:1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
/usr/include/ctype.h:263:1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  263 | __exctype_l (isblank_l);
      | ^~~~~~~~~~~
/usr/include/ctype.h:263:1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
/usr/include/ctype.h:267:48: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  267 | extern int __tolower_l (int __c, locale_t __l) __THROW;
      |                                                ^~~~~~~
/usr/include/ctype.h:267:48: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
/usr/include/ctype.h:268:46: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  268 | extern int tolower_l (int __c, locale_t __l) __THROW;
      |                                              ^~~~~~~
/usr/include/ctype.h:268:46: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
/usr/include/ctype.h:271:48: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  271 | extern int __toupper_l (int __c, locale_t __l) __THROW;
      |                                                ^~~~~~~
/usr/include/ctype.h:271:48: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
/usr/include/ctype.h:272:46: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  272 | extern int toupper_l (int __c, locale_t __l) __THROW;
      |                                              ^~~~~~~
/usr/include/ctype.h:272:46: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
/usr/include/errno.h:37:45: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
   37 | extern int *__errno_location (void) __THROW __attribute_const__;
      |                                             ^~~~~~~~~~~~~~~~~~~
/usr/include/errno.h:37:45: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
/usr/include/locale.h:122:63: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  122 | extern char *setlocale (int __category, const char *__locale) __THROW;
      |                                                               ^~~~~~~
/usr/include/locale.h:122:63: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
/usr/include/locale.h:125:40: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  125 | extern struct lconv *localeconv (void) __THROW;
      |                                        ^~~~~~~
/usr/include/locale.h:125:40: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
/usr/include/locale.h:142:24: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  142 |       locale_t __base) __THROW;
      |                        ^~~~~~~
/usr/include/locale.h:142:24: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
/usr/include/locale.h:176:48: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  176 | extern locale_t duplocale (locale_t __dataset) __THROW;
      |                                                ^~~~~~~
/usr/include/locale.h:176:48: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
/usr/include/locale.h:180:45: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  180 | extern void freelocale (locale_t __dataset) __THROW;
      |                                             ^~~~~~~
/usr/include/locale.h:180:45: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
/usr/include/locale.h:187:48: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  187 | extern locale_t uselocale (locale_t __dataset) __THROW;
      |                                                ^~~~~~~
/usr/include/locale.h:187:48: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
In file included from /usr/include/c++/10/cmath:42,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from islands.cpp:2:
/usr/include/c++/10/bits/cpp_type_traits.h:500:32: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  500 |     __miter_base(_Iterator __it)
      |                                ^
In file included from /usr/include/c++/10/cmath:43,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from islands.cpp:2:
/usr/include/c++/10/ext/type_traits.h:152:35: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  152 |     __is_null_pointer(_Type* __ptr)
      |                                   ^
/usr/include/c++/10/ext/type_traits.h:157:28: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  157 |     __is_null_pointer(_Type)
      |                            ^
/usr/include/c++/10/ext/type_traits.h:162:35: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  162 |   __is_null_pointer(std::nullptr_t)
      |                                   ^
In file included from /usr/include/math.h:289,
                 from /usr/include/c++/10/cmath:45,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from islands.cpp:2:
/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h:22:32: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
   22 |      __attribute__ ((__const__));
      |                                ^
/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h:22:32: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h:26:32: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
   26 |      __attribute__ ((__const__));
      |                                ^
/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h:26:32: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h:30:77: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
   30 | __MATHDECL_1 (int, __isinf,, (_Mdouble_ __value)) __attribute__ ((__const__));
      |                                                                             ^
/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h:30:77: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h:33:78: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
   33 | __MATHDECL_1 (int, __finite,, (_Mdouble_ __value)) __attribute__ ((__const__));
      |                                                                              ^
/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h:33:78: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h:36:77: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
   36 | __MATHDECL_1 (int, __isnan,, (_Mdouble_ __value)) __attribute__ ((__const__));
      |                                                                             ^
/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h:36:77: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
In file included from /usr/include/features.h:461,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/os_defines.h:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/c++config.h:518,
                 from /usr/include/c++/10/cassert:43,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:33,
                 from islands.cpp:2:
/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h:39:1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
   39 | __MATHDECL_1 (int, __iseqsig,, (_Mdouble_ __x, _Mdouble_ __y));
      | ^~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h:39:1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
In file included from /usr/include/math.h:289,
                 from /usr/include/c++/10/cmath:45,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from islands.cpp:2:
/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h:43:32: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
   43 |      __attribute__ ((__const__));
      |                                ^
/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h:43:32: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
In file included from /usr/include/features.h:461,
                 from