swap.cpp:8:82: error: 'int close [400005]' redeclared as different kind of entity
8 | int check[maxn], par[maxn], siz[maxn], weight[maxn], rt[maxn], cnt, n, close[maxn], saad[maxn], jump[maxn][20];
| ^
In file included from /usr/include/c++/13/bits/atomic_wait.h:45,
from /usr/include/c++/13/bits/atomic_base.h:42,
from /usr/include/c++/13/bits/shared_ptr_atomic.h:33,
from /usr/include/c++/13/memory:81,
from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:56,
from swap.cpp:2:
/usr/include/unistd.h:358:12: note: previous declaration 'int close(int)'
358 | extern int close (int __fd);
| ^~~~~
swap.cpp: In function 'void make(int)':
swap.cpp:18:12: warning: pointer to a function used in arithmetic [-Wpointer-arith]
18 | close[v] = -1;
| ^
swap.cpp:18:14: error: assignment of read-only location '*(close + ((sizetype)v))'
18 | close[v] = -1;
| ~~~~~~~~~^~~~
swap.cpp: In function 'void dfs(int)':
swap.cpp:59:20: warning: pointer to a function used in arithmetic [-Wpointer-arith]
59 | if (close[u] < 0) close[u] = 1e9;
| ^
swap.cpp:59:22: error: ordered comparison of pointer with integer zero ('int (*)(int)' and 'int')
59 | if (close[u] < 0) close[u] = 1e9;
| ~~~~~~~~~^~~
swap.cpp:59:34: warning: pointer to a function used in arithmetic [-Wpointer-arith]
59 | if (close[u] < 0) close[u] = 1e9;
| ^
swap.cpp:59:36: error: assignment of read-only location '*(close + ((sizetype)u))'
59 | if (close[u] < 0) close[u] = 1e9;
| ~~~~~~~~~^~~~~
swap.cpp:60:29: warning: pointer to a function used in arithmetic [-Wpointer-arith]
60 | if (saad[u]) close[u] = weight[u];
| ^
swap.cpp:60:31: error: assignment of read-only location '*(close + ((sizetype)u))'
60 | if (saad[u]) close[u] = weight[u];
| ~~~~~~~~~^~~~~~~~~~~
swap.cpp:61:16: warning: pointer to a function used in arithmetic [-Wpointer-arith]
61 | close[u] = min(close[u], close[v]);
| ^
swap.cpp:61:31: warning: pointer to a function used in arithmetic [-Wpointer-arith]
61 | close[u] = min(close[u], close[v]);
| ^
swap.cpp:61:41: warning: pointer to a function used in arithmetic [-Wpointer-arith]
61 | close[u] = min(close[u], close[v]);
| ^
swap.cpp:61:18: error: assignment of read-only location '*(close + ((sizetype)u))'
61 | close[u] = min(close[u], close[v]);
| ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
swap.cpp: In function 'void init(int, int, std::vector<int>, std::vector<int>, std::vector<int>)':
swap.cpp:105:45: warning: pointer to a function used in arithmetic [-Wpointer-arith]
105 | if (saad[cnt + n - 1]) close[cnt + n - 1] = weight[cnt + n - 1];
| ^
cc1plus: warning: pointer to a function used in arithmetic [-Wpointer-arith]
swap.cpp:105:47: error: assignment of read-only location '*(close + (((sizetype)(cnt + n)) + 18446744073709551615))'
105 | if (saad[cnt + n - 1]) close[cnt + n - 1] = weight[cnt + n - 1];
| ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
swap.cpp: In function 'int getMinimumFuelCapacity(int, int)':
swap.cpp:117:17: warning: pointer to a function used in arithmetic [-Wpointer-arith]
117 | return close[w];
| ^
swap.cpp:117:17: error: invalid conversion from 'int (*)(int)' to 'int' [-fpermissive]
117 | return close[w];
| ^
| |
| int (*)(int)