ID 6017379
Пользователь Морозов Денис Витальевич
Время 20.01.2022 20:15<< 22.01.2022 18:34 (1 д. 22:24)
Обработка 18:34 ... 18:34 (2,98 сек.)
Файл 6017379.cpp (CLang++ 5.0.0 + Address Sanitizer)
Турнир 2 курс. Программирование на C++. Турнир 3, осень 2021
Задача A: Slicer
Набор тестов
Ограничения Время: 1с Память: 4000Мб
Состояние  [?]
CE Ошибка компиляции
код | результаты
In file included from main.cpp:1:0:
solution.h:16:5: error: 'size_t' does not name a type; did you mean '__size_t'?
     size_t size() const {
     ^~~~~~
     __size_t
solution.h:24:5: error: 'size_t' does not name a type; did you mean '__size_t'?
     size_t size_;
     ^~~~~~
     __size_t
solution.h:25:5: error: 'vector' does not name a type; did you mean 'Iterator'?
     vector<SlicerRange<Iterator>> pages_;
     ^~~~~~
     Iterator
solution.h:27:36: error: 'size_t' has not been declared
     Slicer(Iterator b, Iterator e, size_t page_size) {
                                    ^~~~~~
solution.h:37:5: error: 'size_t' does not name a type; did you mean '__size_t'?
     size_t size() const {
     ^~~~~~
     __size_t
solution.h: In constructor 'Slicer<Iterator>::Slicer(Iterator, Iterator, int)':
solution.h:29:9: error: 'size_' was not declared in this scope
         size_ = d / page_size + (d % page_size != 0 ? 1 : 0);
         ^~~~~
solution.h:29:9: note: suggested alternative: '__size_t'
         size_ = d / page_size + (d % page_size != 0 ? 1 : 0);
         ^~~~~
         __size_t
solution.h:33:13: error: 'pages_' was not declared in this scope
             pages_.push_back({b_it, e_it});
             ^~~~~~
solution.h:33:13: note: suggested alternative: 'page_size'
             pages_.push_back({b_it, e_it});
             ^~~~~~
             page_size
solution.h: In member function 'auto Slicer<Iterator>::begin()':
solution.h:42:16: error: 'pages_' was not declared in this scope
         return pages_.begin();
                ^~~~~~
solution.h: In member function 'auto Slicer<Iterator>::end()':
solution.h:46:16: error: 'pages_' was not declared in this scope
         return pages_.end();
                ^~~~~~
solution.h: At global scope:
solution.h:51:18: error: 'size_t' has not been declared
 auto Slice(C& c, size_t page_size) {
                  ^~~~~~
In file included from /usr/include/c++/7/cassert:44:0,
                 from main.cpp:12:
main.cpp: In function 'void TestPageCounts()':
main.cpp:25:22: error: 'class Slicer<__gnu_cxx::__normal_iterator<int*, std::vector<int> > >' has no member named 'size'
   assert(Slice(v, 1).size() == v.size());
                      ^
main.cpp:26:22: error: 'class Slicer<__gnu_cxx::__normal_iterator<int*, std::vector<int> > >' has no member named 'size'
   assert(Slice(v, 3).size() == 5u);
                      ^
main.cpp:27:22: error: 'class Slicer<__gnu_cxx::__normal_iterator<int*, std::vector<int> > >' has no member named 'size'
   assert(Slice(v, 5).size() == 3u);
                      ^
main.cpp:28:22: error: 'class Slicer<__gnu_cxx::__normal_iterator<int*, std::vector<int> > >' has no member named 'size'
   assert(Slice(v, 4).size() == 4u);
                      ^
main.cpp:29:23: error: 'class Slicer<__gnu_cxx::__normal_iterator<int*, std::vector<int> > >' has no member named 'size'
   assert(Slice(v, 15).size() == 1u);
                       ^
main.cpp:30:24: error: 'class Slicer<__gnu_cxx::__normal_iterator<int*, std::vector<int> > >' has no member named 'size'
   assert(Slice(v, 150).size() == 1u);
                        ^
main.cpp:31:23: error: 'class Slicer<__gnu_cxx::__normal_iterator<int*, std::vector<int> > >' has no member named 'size'
   assert(Slice(v, 14).size() == 2u);
                       ^
main.cpp: In function 'void TestLooping()':
main.cpp:40:27: error: 'void __for_begin' has incomplete type
   for (const auto& page : slice_v) {
                           ^~~~~~~
main.cpp:40:27: error: 'void __for_end' has incomplete type
main.cpp:41:18: error: unable to deduce 'auto&&' from 'page'
     for (int x : page) {
                  ^~~~
main.cpp: In function 'void TestModification()':
main.cpp:52:31: error: 'void __for_begin' has incomplete type
   for (auto page : Slice(vs, 2)) {
                               ^
main.cpp:52:31: error: 'void __for_end' has incomplete type
main.cpp:53:23: error: unable to deduce 'auto&&' from 'page'
     for (auto& word : page) {
                       ^~~~
main.cpp: In function 'void TestPageSizes()':
main.cpp:67:27: error: 'void __for_begin' has incomplete type
   for (const auto& page : letters_slices) {
                           ^~~~~~~~~~~~~~
main.cpp:67:27: error: 'void __for_end' has incomplete type
main.cpp: In function 'void TestConstContainer()':
main.cpp:79:44: error: 'void __for_begin' has incomplete type
   for (const auto& page : Slice(letters, 10)) {
                                            ^
main.cpp:79:44: error: 'void __for_end' has incomplete type
main.cpp: In function 'void TestPagination()':
main.cpp:92:43: error: 'void __for_begin' has incomplete type
   for (const auto& split_by_9 : Slice(v, 9)) {
                                           ^
main.cpp:92:43: error: 'void __for_end' has incomplete type
main.cpp:95:23: error: unable to deduce 'auto&&' from 'split_by_4'
       for (int item : split_by_4) {
                       ^~~~~~~~~~
[печатать | |
]
(1 158 b)
0.064s 0.013s 10