QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#186642#6739. Teleportucup-team580#Compile Error//C++204.8kb2023-09-24 08:17:462023-09-24 08:17:48

Details

answer.code:163:42: error: ‘int link [5010][5010]’ redeclared as different kind of entity
  163 | int dist[MAX_N][MAX_N], link[MAX_N][MAX_N];
      |                                          ^
In file included from /usr/include/c++/11/bits/atomic_wait.h:44,
                 from /usr/include/c++/11/bits/atomic_base.h:41,
                 from /usr/include/c++/11/bits/shared_ptr_atomic.h:33,
                 from /usr/include/c++/11/memory:78,
                 from answer.code:51:
/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 ‘int get_next(int, int)’:
answer.code:170:18: warning: pointer to a function used in arithmetic [-Wpointer-arith]
  170 |     return link[r][c] == 0 ? 0 : link[r][c] += get_next(r + link[r][c], c + link[r][c]);
      |                  ^
answer.code:170:21: warning: pointer to a function used in arithmetic [-Wpointer-arith]
  170 |     return link[r][c] == 0 ? 0 : link[r][c] += get_next(r + link[r][c], c + link[r][c]);
      |                     ^
answer.code:170:40: warning: pointer to a function used in arithmetic [-Wpointer-arith]
  170 |     return link[r][c] == 0 ? 0 : link[r][c] += get_next(r + link[r][c], c + link[r][c]);
      |                                        ^
answer.code:170:43: warning: pointer to a function used in arithmetic [-Wpointer-arith]
  170 |     return link[r][c] == 0 ? 0 : link[r][c] += get_next(r + link[r][c], c + link[r][c]);
      |                                           ^
answer.code:170:67: warning: pointer to a function used in arithmetic [-Wpointer-arith]
  170 |     return link[r][c] == 0 ? 0 : link[r][c] += get_next(r + link[r][c], c + link[r][c]);
      |                                                                   ^
answer.code:170:70: warning: pointer to a function used in arithmetic [-Wpointer-arith]
  170 |     return link[r][c] == 0 ? 0 : link[r][c] += get_next(r + link[r][c], c + link[r][c]);
      |                                                                      ^
answer.code:170:59: warning: pointer to a function used in arithmetic [-Wpointer-arith]
  170 |     return link[r][c] == 0 ? 0 : link[r][c] += get_next(r + link[r][c], c + link[r][c]);
      |                                                         ~~^~~~~~~~~~~~
answer.code:170:83: warning: pointer to a function used in arithmetic [-Wpointer-arith]
  170 |     return link[r][c] == 0 ? 0 : link[r][c] += get_next(r + link[r][c], c + link[r][c]);
      |                                                                                   ^
answer.code:170:86: warning: pointer to a function used in arithmetic [-Wpointer-arith]
  170 |     return link[r][c] == 0 ? 0 : link[r][c] += get_next(r + link[r][c], c + link[r][c]);
      |                                                                                      ^
answer.code:170:75: warning: pointer to a function used in arithmetic [-Wpointer-arith]
  170 |     return link[r][c] == 0 ? 0 : link[r][c] += get_next(r + link[r][c], c + link[r][c]);
      |                                                                         ~~^~~~~~~~~~~~
answer.code:170:59: error: invalid conversion from ‘int (*)(const char*, const char*) noexcept’ to ‘int’ [-fpermissive]
  170 |     return link[r][c] == 0 ? 0 : link[r][c] += get_next(r + link[r][c], c + link[r][c]);
      |                                                         ~~^~~~~~~~~~~~
      |                                                           |
      |                                                           int (*)(const char*, const char*) noexcept
answer.code:169:18: note:   initializing argument 1 of ‘int get_next(int, int)’
  169 | int get_next(int r, int c) {
      |              ~~~~^
answer.code:170:75: error: invalid conversion from ‘int (*)(const char*, const char*) noexcept’ to ‘int’ [-fpermissive]
  170 |     return link[r][c] == 0 ? 0 : link[r][c] += get_next(r + link[r][c], c + link[r][c]);
      |                                                                         ~~^~~~~~~~~~~~
      |                                                                           |
      |                                                                           int (*)(const char*, const char*) noexcept
answer.code:169:25: note:   initializing argument 2 of ‘int get_next(int, int)’
  169 | int get_next(int r, int c) {
      |                     ~~~~^
answer.code:170:45: warning: pointer to a function used in arithmetic [-Wpointer-arith]
  170 |     return link[r][c] == 0 ? 0 : link[r][c] += get_next(r + link[r][c], c + link[r][c]);
      |                                  ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
answer.code:170:45: error: assignment of read-only location ‘*(link + (((sizetype)r) + ((sizetype)c)))’
answer.code: In function ‘void destroy(int, int)’:
answer.code:175:11: warning: point...