QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#597043#9352. Highway BusesMaMengQiCompile Error//C++206.9kb2024-09-28 16:56:212024-09-28 16:56:21

詳細信息

answer.code:27:52: error: ‘int link [400410]’ redeclared as different kind of entity
   27 | int tot_edge, head[maxn], to[maxn<<1], link[maxn<<1];
      |                                                    ^
In file included from /usr/include/c++/13/bits/atomic_wait.h:44,
                 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 answer.code:1:
/usr/include/unistd.h:789:12: note: previous declaration ‘int link(const char*, const char*)’
  789 | extern int link (const char *__from, const char *__to)
      |            ^~~~
answer.code: In function ‘void add_edge(int, int)’:
answer.code:30:18: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   30 |     link[tot_edge] = head[x];
      |                  ^
answer.code:30:20: error: assignment of read-only location ‘*(link + ((sizetype)tot_edge))’
   30 |     link[tot_edge] = head[x];
      |     ~~~~~~~~~~~~~~~^~~~~~~~~
answer.code: In function ‘void O1_LCA::dfs(int, int)’:
answer.code:45:40: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   45 |     for (int j = head[x]; j; j = link[j]) {
      |                                        ^
answer.code:45:40: error: invalid conversion from ‘int (*)(const char*, const char*) noexcept’ to ‘int’ [-fpermissive]
   45 |     for (int j = head[x]; j; j = link[j]) {
      |                                  ~~~~~~^
      |                                        |
      |                                        int (*)(const char*, const char*) noexcept
answer.code: In function ‘void DFT::findroot(int, int, int)’:
answer.code:92:40: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   92 |     for (int j = head[x]; j; j = link[j]) {
      |                                        ^
answer.code:92:40: error: invalid conversion from ‘int (*)(const char*, const char*) noexcept’ to ‘int’ [-fpermissive]
   92 |     for (int j = head[x]; j; j = link[j]) {
      |                                  ~~~~~~^
      |                                        |
      |                                        int (*)(const char*, const char*) noexcept
answer.code: In function ‘void DFT::dfs(int, int, int)’:
answer.code:104:40: warning: pointer to a function used in arithmetic [-Wpointer-arith]
  104 |     for (int j = head[x]; j; j = link[j]) {
      |                                        ^
answer.code:104:40: error: invalid conversion from ‘int (*)(const char*, const char*) noexcept’ to ‘int’ [-fpermissive]
  104 |     for (int j = head[x]; j; j = link[j]) {
      |                                  ~~~~~~^
      |                                        |
      |                                        int (*)(const char*, const char*) noexcept
answer.code: In function ‘void DFT::dfs2(int, int, int)’:
answer.code:113:43: warning: pointer to a function used in arithmetic [-Wpointer-arith]
  113 |     for(int now=head[x]; now; now=link[now]) {
      |                                           ^
answer.code:113:43: error: invalid conversion from ‘int (*)(const char*, const char*) noexcept’ to ‘int’ [-fpermissive]
  113 |     for(int now=head[x]; now; now=link[now]) {
      |                                   ~~~~~~~~^
      |                                           |
      |                                           int (*)(const char*, const char*) noexcept
answer.code: In function ‘void DFT::solve(int, int)’:
answer.code:124:40: warning: pointer to a function used in arithmetic [-Wpointer-arith]
  124 |     for (int j = head[x]; j; j = link[j]) {
      |                                        ^
answer.code:124:40: error: invalid conversion from ‘int (*)(const char*, const char*) noexcept’ to ‘int’ [-fpermissive]
  124 |     for (int j = head[x]; j; j = link[j]) {
      |                                  ~~~~~~^
      |                                        |
      |                                        int (*)(const char*, const char*) noexcept
answer.code:129:40: warning: pointer to a function used in arithmetic [-Wpointer-arith]
  129 |     for (int j = head[x]; j; j = link[j]) {
      |                                        ^
answer.code:129:40: error: invalid conversion from ‘int (*)(const char*, const char*) noexcept’ to ‘int’ [-fpermissive]
  129 |     for (int j = head[x]; j; j = link[j]) {
      |                                  ~~~~~~^
      |                                        |
      |                                        int (*)(const char*, const char*) noexcept
answer.code: In function ‘void bfs(int*, int, int)’:
answer.code:154:47: warning: pointer to a function used in arithmetic [-Wpointer-arith]
  154 |         for(int now=head[x]; now; now=link[now])
      |                                               ^
answer.code:154:47: erro...