Submission #00107


ソースコード

ステータス

項目 データ
問題 0004 - Jewel Robbery
ユーザー名 ei1630
投稿日時 2020-05-05 22:01:05
言語 C++17
状態 Compile Error
得点 0
ソースコード長 925 Byte
最大実行時間 -
最大メモリ使用量

コンパイルメッセージ

./Main.cpp:6:23: error: wrong number of template arguments (1, should be 2)
 typedef pair<long long>P;
                       ^
In file included from /usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_algobase.h:64,
                 from /usr/local/gcc-8.2.0/include/c++/8.2.0/bits/char_traits.h:39,
                 from /usr/local/gcc-8.2.0/include/c++/8.2.0/ios:40,
                 from /usr/local/gcc-8.2.0/include/c++/8.2.0/ostream:38,
                 from /usr/local/gcc-8.2.0/include/c++/8.2.0/iostream:39,
                 from ./Main.cpp:1:
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_pair.h:198:12: note: provided for ‘template<class _T1, class _T2> struct std::pair’
     struct pair
            ^~~~
./Main.cpp: In function ‘int main()’:
./Main.cpp:16:24: error: expression list treated as compound expression in functional cast [-fpermissive]
     vec.push_back(P(p,v));
                        ^
./Main.cpp:19:15: error: request for member ‘first’ in ‘vec.std::vector<int>::operator[](((std::vector<int>::size_type)i))’, which is of non-class type ‘__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type’ {aka ‘int’}
     if(vec[i].first-vec[i-1].first-1>=len){
               ^~~~~
./Main.cpp:19:30: error: request for member ‘first’ in ‘vec.std::vector<int>::operator[](((std::vector<int>::size_type)(i - 1)))’, which is of non-class type ‘__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type’ {aka ‘int’}
     if(vec[i].first-vec[i-1].first-1>=len){
                              ^~~~~
./Main.cpp:27:22: error: expression list treated as compound expression in functional cast [-fpermissive]
   vec.push_back(P(n,0));
                      ^
./Main.cpp:29:20: error: request for member ‘first’ in ‘vec.std::vector<int>::operator[](((std::vector<int>::size_type)index))’, which is of non-class type ‘__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type’ {aka ‘int’}
   while(vec[index].first-vec[tail].first+1<=len&&index<vec.size()){
                    ^~~~~
./Main.cpp:29:36: error: request for member ‘first’ in ‘vec.std::vector<int>::operator[](((std::vector<int>::size_type)tail))’, which is of non-class type ‘__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type’ {aka ‘int’}
   while(vec[index].first-vec[tail].first+1<=len&&index<vec.size()){
                                    ^~~~~
./Main.cpp:30:23: error: request for member ‘second’ in ‘vec.std::vector<int>::operator[](((std::vector<int>::size_type)index))’, which is of non-class type ‘__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type’ {aka ‘int’}
     v_sum+=vec[index].second;
                       ^~~~~~
./Main.cpp:36:18: error: request for member ‘first’ in ‘vec.std::vector<int>::operator[](((std::vector<int>::size_type)i))’, which is of non-class type ‘__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type’ {aka ‘int’}
     while(vec[i].first-vec[tail].first+1>len){
                  ^~~~~
./Main.cpp:36:34: error: request for member ‘first’ in ‘vec.std::vector<int>::operator[](((std::vector<int>::size_type)tail))’, which is of non-class type ‘__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type’ {aka ‘int’}
     while(vec[i].first-vec[tail].first+1>len){
                                  ^~~~~
./Main.cpp:37:24: error: request for member ‘second’ in ‘vec.std::vector<int>::operator[](((std::vector<int>::size_type)tail))’, which is of non-class type ‘__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type’ {aka ‘int’}
       v_sum-=vec[tail].second;
                        ^~~~~~
./Main.cpp:40:19: error: request for member ‘second’ in ‘vec.std::vector<int>::operator[](((std::vector<int>::size_type)i))’, which is of non-class type ‘__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type’ {aka ‘int’}
     v_sum+=vec[i].second;
                   ^~~~~~

セット

セット 得点 Cases

テストケース

ファイル名 状態 実行時間 メモリ使用量 #