foo.cc: In function 'int main()':
foo.cc:13:50: error: wrong number of template arguments (0, should be 1)
13 | priority_queue <int, vector<int>, greater<>> a;
| ^
In file included from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/string:48,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/bits/locale_classes.h:40,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/bits/ios_base.h:41,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/ios:42,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/ostream:38,
from iostream:39:
/nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/bits/stl_function.h:385:12: note: provided for 'template<class _Tp> struct std::greater'
385 | struct greater : public binary_function<_Tp, _Tp, bool>
| ^~~~~~~
foo.cc:13:51: error: template argument 3 is invalid
13 | priority_queue <int, vector<int>, greater<>> a;
| ^~
foo.cc:14:47: error: wrong number of template arguments (0, should be 1)
14 | priority_queue <int, vector<int>, less<>> b;
| ^
In file included from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/string:48,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/bits/locale_classes.h:40,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/bits/ios_base.h:41,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/ios:42,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/ostream:38,
from iostream:39:
/nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/bits/stl_function.h:395:12: note: provided for 'template<class _Tp> struct std::less'
395 | struct less : public binary_function<_Tp, _Tp, bool>
| ^~~~
foo.cc:14:48: error: template argument 3 is invalid
14 | priority_queue <int, vector<int>, less<>> b;
| ^~
foo.cc:19:19: error: request for member 'push' in 'a', which is of non-class type 'int'
19 | a.push(temp);
| ^~~~
foo.cc:20:19: error: request for member 'push' in 'b', which is of non-class type 'int'
20 | b.push(temp);
| ^~~~
foo.cc:26:25: error: request for member 'top' in 'a', which is of non-class type 'int'
26 | top = a.top();
| ^~~
foo.cc:27:28: error: request for member 'top' in 'b', which is of non-class type 'int'
27 | bottom = b.top();
| ^~~
foo.cc:30:27: error: request for member 'pop' in 'b', which is of non-class type 'int'
30 | b.pop();
| ^~~
foo.cc:36:27: error: request for member 'pop' in 'b', which is of non-class type 'int'
36 | b.pop();
| ^~~
foo.cc:37:27: error: request for member 'pop' in 'a', which is of non-class type 'int'
37 | a.pop();
| ^~~
foo.cc:40:23: error: request for member 'size' in 'a', which is of non-class type 'int'
40 | if (a.size() == n / 2 || b.size() == n / 2)
| ^~~~
foo.cc:40:44: error: request for member 'size' in 'b', which is of non-class type 'int'
40 | if (a.size() == n / 2 || b.size() == n / 2)
| ^~~~
[Hydro](https://hydro.ac)提供评测服务