/ Vijos /

记录详情

Compile Error

/in/foo.cc:9:25: error: 'vector' was not declared in this scope
 std::priority_queue<int,vector<int>,greater<int> > q;
                         ^~~~~~
/in/foo.cc:9:25: note: suggested alternative:
In file included from /usr/include/c++/6/vector:64:0,
                 from /usr/include/c++/6/queue:61,
                 from /in/foo.cc:6:
/usr/include/c++/6/bits/stl_vector.h:214:11: note:   'std::vector'
     class vector : protected _Vector_base<_Tp, _Alloc>
           ^~~~~~
/in/foo.cc:9:35: error: template argument 2 is invalid
 std::priority_queue<int,vector<int>,greater<int> > q;
                                   ^
/in/foo.cc:9:35: error: template argument 3 is invalid
/in/foo.cc:9:36: error: expected unqualified-id before ',' token
 std::priority_queue<int,vector<int>,greater<int> > q;
                                    ^
/in/foo.cc:9:44: error: expected initializer before '<' token
 std::priority_queue<int,vector<int>,greater<int> > q;
                                            ^
/in/foo.cc: In function 'int main()':
/in/foo.cc:15:36: error: 'q' was not declared in this scope
     for(int i=0;i<n;i++){cin>>b[i];q.push(b[i]);}
                                    ^
/in/foo.cc:16:11: error: 'q' was not declared in this scope
     while(q.size()>2)
           ^

信息

递交者
类型
递交
题目
P1097 合并果子
语言
C++
递交时间
2017-09-03 17:26:07
评测时间
2017-09-03 17:26:07
评测机
分数
0
总耗时
268ms
峰值内存
37.129 MiB