QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#544125#6253. Appeal to the Audience HuangHanShengCompile Error//C++201.5kb2024-09-02 09:57:562024-09-02 09:57:57

詳細信息

answer.code:44:21: error: ‘std::priority_queue<int> link’ redeclared as different kind of entity
   44 | priority_queue<int> link, kp;
      |                     ^~~~
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 ‘int main()’:
answer.code:54:60: error: request for member ‘push’ in ‘link’, which is of non-class type ‘int(const char*, const char*) noexcept’
   54 |         for (int i = 2; i <= n; ++i) if (top[i] == i) link.push(len[i]);
      |                                                            ^~~~
answer.code:55:14: error: request for member ‘push’ in ‘link’, which is of non-class type ‘int(const char*, const char*) noexcept’
   55 |         link.push(len[1] - 1);
      |              ^~~~
answer.code:57:21: error: request for member ‘size’ in ‘link’, which is of non-class type ‘int(const char*, const char*) noexcept’
   57 |         while (link.size()) ret += link.top() * kp.top(), link.pop(), kp.pop();
      |                     ^~~~
answer.code:57:41: error: request for member ‘top’ in ‘link’, which is of non-class type ‘int(const char*, const char*) noexcept’
   57 |         while (link.size()) ret += link.top() * kp.top(), link.pop(), kp.pop();
      |                                         ^~~
answer.code:57:64: error: request for member ‘pop’ in ‘link’, which is of non-class type ‘int(const char*, const char*) noexcept’
   57 |         while (link.size()) ret += link.top() * kp.top(), link.pop(), kp.pop();
      |                                                                ^~~