QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#778800#5268. Computer NetworkGuanYunchangCompile Error//C++111.0kb2024-11-24 16:22:162024-11-24 16:22:17

Details

answer.code: In function ‘void solve()’:
answer.code:17:45: error: wrong number of template arguments (0, should be 1)
   17 |     priority_queue<int, vector<int>, greater<>> q;
      |                                             ^
In file included from /usr/include/c++/13/string:49,
                 from /usr/include/c++/13/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:52,
                 from answer.code:3:
/usr/include/c++/13/bits/stl_function.h:393:12: note: provided for ‘template<class _Tp> struct std::greater’
  393 |     struct greater : public binary_function<_Tp, _Tp, bool>
      |            ^~~~~~~
answer.code:17:46: error: template argument 3 is invalid
   17 |     priority_queue<int, vector<int>, greater<>> q;
      |                                              ^~
answer.code:21:15: error: request for member ‘push’ in ‘q’, which is of non-class type ‘int’
   21 |             q.push(a[i]);
      |               ^~~~
answer.code:23:22: error: request for member ‘top’ in ‘q’, which is of non-class type ‘int’
   23 |             ans += q.top() + a[i];
      |                      ^~~
answer.code:24:15: error: request for member ‘push’ in ‘q’, which is of non-class type ‘int’
   24 |             q.push(q.top() + a[i]);
      |               ^~~~
answer.code:24:22: error: request for member ‘top’ in ‘q’, which is of non-class type ‘int’
   24 |             q.push(q.top() + a[i]);
      |                      ^~~
answer.code:25:15: error: request for member ‘pop’ in ‘q’, which is of non-class type ‘int’
   25 |             q.pop();
      |               ^~~