QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#169879#7185. Poor Studentsucup-team1837#Compile Error//C++2010.1kb2023-09-09 14:13:082023-09-09 14:13:08

Details

answer.code:145:97: error: ‘int link [1100038]’ redeclared as different kind of entity
  145 | int heap[50016], pos[50016], nheap = 0, n, k, m, head[50016], ptr[50016], link[(550016 << 1) + 6], lim = (1 << 16), depth[50016];
      |                                                                                                 ^
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 /usr/include/c++/11/ext/pb_ds/detail/standard_policies.hpp:44,
                 from /usr/include/c++/11/ext/pb_ds/assoc_container.hpp:47,
                 from answer.code:20:
/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 ‘bool Dijkstra()’:
answer.code:191:48: warning: pointer to a function used in arithmetic [-Wpointer-arith]
  191 |         for(int i = head[u]; i > -1; i = link[i]) {
      |                                                ^
answer.code:191:48: error: invalid conversion from ‘int (*)(const char*, const char*) noexcept’ to ‘int’ [-fpermissive]
  191 |         for(int i = head[u]; i > -1; i = link[i]) {
      |                                          ~~~~~~^
      |                                                |
      |                                                int (*)(const char*, const char*) noexcept
answer.code: In function ‘bool DFS(int)’:
answer.code:209:44: warning: pointer to a function used in arithmetic [-Wpointer-arith]
  209 |     for(int &i = ptr[u]; i > -1; i = link[i]) {
      |                                            ^
answer.code:209:44: error: invalid conversion from ‘int (*)(const char*, const char*) noexcept’ to ‘int’ [-fpermissive]
  209 |     for(int &i = ptr[u]; i > -1; i = link[i]) {
      |                                      ~~~~~~^
      |                                            |
      |                                            int (*)(const char*, const char*) noexcept
answer.code: In function ‘void add_edge(int, int, int, int)’:
answer.code:225:11: warning: pointer to a function used in arithmetic [-Wpointer-arith]
  225 |     link[m] = head[u]; head[u] = m++;
      |           ^
answer.code:225:13: error: assignment of read-only location ‘*(link + ((sizetype)m))’
  225 |     link[m] = head[u]; head[u] = m++;
      |     ~~~~~~~~^~~~~~~~~
answer.code:227:11: warning: pointer to a function used in arithmetic [-Wpointer-arith]
  227 |     link[m] = head[v]; head[v] = m++;
      |           ^
answer.code:227:13: error: assignment of read-only location ‘*(link + ((sizetype)m))’
  227 |     link[m] = head[v]; head[v] = m++;
      |     ~~~~~~~~^~~~~~~~~