QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#254333#7748. Karshilov's Matching Problem IIucup-team881#Compile Error//C++202.4kb2023-11-18 11:13:522023-11-18 11:13:53

Details

answer.code:16:33: error: ‘long long int link [200005]’ redeclared as different kind of entity
   16 | int T, n, w[N], sw[N], m, link[N], pre[N], L[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 /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:82,
                 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 ‘int main()’:
answer.code:80:57: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   80 |                 while (j && s[i] != s[j]) j = link[j - 1];
      |                                                         ^
cc1plus: warning: pointer to a function used in arithmetic [-Wpointer-arith]
answer.code:80:57: error: invalid conversion from ‘int (*)(const char*, const char*) noexcept’ to ‘long long int’ [-fpermissive]
   80 |                 while (j && s[i] != s[j]) j = link[j - 1];
      |                                               ~~~~~~~~~~^
      |                                                         |
      |                                                         int (*)(const char*, const char*) noexcept
answer.code:82:23: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   82 |                 link[i] = j;
      |                       ^
answer.code:82:25: error: assignment of read-only location ‘*(link + ((sizetype)i))’
   82 |                 link[i] = j;
      |                 ~~~~~~~~^~~