0_0_29172355_21946.cpp: In function 'int main()':
0_0_29172355_21946.cpp:26:42: error: wrong number of template arguments (0, should be 1)
priority_queue<int,vector<int>,greater<> >x;
^
In file included from GCC4.9.2/x86_64-w64-mingw32/include/c++/string:48:0,
from GCC4.9.2/x86_64-w64-mingw32/include/c++/bits/locale_classes.h:40,
from GCC4.9.2/x86_64-w64-mingw32/include/c++/bits/ios_base.h:41,
from GCC4.9.2/x86_64-w64-mingw32/include/c++/ios:42,
from GCC4.9.2/x86_64-w64-mingw32/include/c++/istream:38,
from GCC4.9.2/x86_64-w64-mingw32/include/c++/sstream:38,
from GCC4.9.2/x86_64-w64-mingw32/include/c++/complex:45,
from GCC4.9.2/x86_64-w64-mingw32/include/c++/ccomplex:38,
from GCC4.9.2/x86_64-w64-mingw32/include/c++/x86_64-w64-mingw32/bits/stdc++.h:52,
from 0_0_29172355_21946.cpp:2:
GCC4.9.2/x86_64-w64-mingw32/include/c++/bits/stl_function.h:358:12: error: provided for 'template<class _Tp> struct std::greater'
struct greater : public binary_function<_Tp, _Tp, bool>
^
0_0_29172355_21946.cpp:26:44: error: template argument 3 is invalid
priority_queue<int,vector<int>,greater<> >x;
^
0_0_29172355_21946.cpp:26:46: error: invalid type in declaration before ';' token
priority_queue<int,vector<int>,greater<> >x;
^
0_0_29172355_21946.cpp:27:39: error: wrong number of template arguments (0, should be 1)
priority_queue<int,vector<int>,less<> >y;
^
In file included from GCC4.9.2/x86_64-w64-mingw32/include/c++/string:48:0,
from GCC4.9.2/x86_64-w64-mingw32/include/c++/bits/locale_classes.h:40,
from GCC4.9.2/x86_64-w64-mingw32/include/c++/bits/ios_base.h:41,
from GCC4.9.2/x86_64-w64-mingw32/include/c++/ios:42,
from GCC4.9.2/x86_64-w64-mingw32/include/c++/istream:38,
from GCC4.9.2/x86_64-w64-mingw32/include/c++/sstream:38,
from GCC4.9.2/x86_64-w64-mingw32/include/c++/complex:45,
from GCC4.9.2/x86_64-w64-mingw32/include/c++/ccomplex:38,
from GCC4.9.2/x86_64-w64-mingw32/include/c++/x86_64-w64-mingw32/bits/stdc++.h:52,
from 0_0_29172355_21946.cpp:2:
GCC4.9.2/x86_64-w64-mingw32/include/c++/bits/stl_function.h:367:12: error: provided for 'template<class _Tp> struct std::less'
struct less : public binary_function<_Tp, _Tp, bool>
^
0_0_29172355_21946.cpp:27:41: error: template argument 3 is invalid
priority_queue<int,vector<int>,less<> >y;
^
0_0_29172355_21946.cpp:27:43: error: invalid type in declaration before ';' token
priority_queue<int,vector<int>,less<> >y;
^
0_0_29172355_21946.cpp:34:10: error: request for member 'empty' in 'x', which is of non-class type 'int'
if(!x.empty()){
^
0_0_29172355_21946.cpp:35:9: error: request for member 'top' in 'x', which is of non-class type 'int'
t=x.top();
^
0_0_29172355_21946.cpp:37:17: error: request for member 'push' in 'y', which is of non-class type 'int'
if(a[i]>t) y.push(a[i]);
^
0_0_29172355_21946.cpp:38:23: error: request for member 'push' in 'x', which is of non-class type 'int'
if(a[i]<=a[i+1]) x.push(a[i]);
^
0_0_29172355_21946.cpp:41:19: error: request for member 'empty' in 'x', which is of non-class type 'int'
while(s<n&& (!x.empty()) && (!y.empty())){
^
0_0_29172355_21946.cpp:41:35: error: request for member 'empty' in 'y', which is of non-class type 'int'
while(s<n&& (!x.empty()) && (!y.empty())){
^
0_0_29172355_21946.cpp:42:13: error: request for member 'top' in 'y', which is of non-class type 'int'
int t1=y.top(),t2=x.top();
^
0_0_29172355_21946.cpp:44:11: error: 't2' was not declared in this scope
if(t1<=t2) break;
^
0_0_29172355_21946.cpp:45:12: error: 't2' was not declared in this scope
ans+=t1-t2;
^
0_0_29172355_21946.cpp:46:6: error: request for member 'pop' in 'y', which is of non-class type 'int'
y.pop();
^
0_0_29172355_21946.cpp:47:6: error: request for member 'pop' in 'x', which is of non-class type 'int'
x.pop();
^
|