ID 5928835
Пользователь Иванов Александр
Время 23.12.2021 17:31 (19 д. 17:32) 18:44>>
Обработка 17:31 ... 17:31 (4.90 сек.)
Файл 5928835.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: In function 'auto Slice(C&, size_t)':
solution.h:63:52: error: type/value mismatch at argument 1 in template parameter list for 'template<class It> class Slicer'
     auto* new_slicer = new Slicer<typeof(c.begin())>(c.begin(), c.end(), page_size);
                                                    ^
solution.h:63:52: note:   expected a type, got 'typeof(c.begin())'
In file included from /usr/include/c++/7/cassert:44:0,
                 from main.cpp:12:
main.cpp: In function 'void TestPageCounts()':
main.cpp:25:15: error: invalid use of 'void'
   assert(Slice(v, 1).size() == v.size());
          ~~~~~^~~~~~
main.cpp:25:22: error: expected ')' before 'size'
   assert(Slice(v, 1).size() == v.size());
                      ^
main.cpp:25:22: error: expected ')' before 'size'
main.cpp:26:15: error: invalid use of 'void'
   assert(Slice(v, 3).size() == 5u);
          ~~~~~^~~~~~
main.cpp:26:22: error: expected ')' before 'size'
   assert(Slice(v, 3).size() == 5u);
                      ^
main.cpp:26:22: error: expected ')' before 'size'
main.cpp:27:15: error: invalid use of 'void'
   assert(Slice(v, 5).size() == 3u);
          ~~~~~^~~~~~
main.cpp:27:22: error: expected ')' before 'size'
   assert(Slice(v, 5).size() == 3u);
                      ^
main.cpp:27:22: error: expected ')' before 'size'
main.cpp:28:15: error: invalid use of 'void'
   assert(Slice(v, 4).size() == 4u);
          ~~~~~^~~~~~
main.cpp:28:22: error: expected ')' before 'size'
   assert(Slice(v, 4).size() == 4u);
                      ^
main.cpp:28:22: error: expected ')' before 'size'
main.cpp:29:15: error: invalid use of 'void'
   assert(Slice(v, 15).size() == 1u);
          ~~~~~^~~~~~~
main.cpp:29:23: error: expected ')' before 'size'
   assert(Slice(v, 15).size() == 1u);
                       ^
main.cpp:29:23: error: expected ')' before 'size'
main.cpp:30:15: error: invalid use of 'void'
   assert(Slice(v, 150).size() == 1u);
          ~~~~~^~~~~~~~
main.cpp:30:24: error: expected ')' before 'size'
   assert(Slice(v, 150).size() == 1u);
                        ^
main.cpp:30:24: error: expected ')' before 'size'
main.cpp:31:15: error: invalid use of 'void'
   assert(Slice(v, 14).size() == 2u);
          ~~~~~^~~~~~~
main.cpp:31:23: error: expected ')' before 'size'
   assert(Slice(v, 14).size() == 2u);
                       ^
main.cpp:31:23: error: expected ')' before 'size'
main.cpp: In function 'void TestModification()':
main.cpp:52:31: error: forming reference to void
   for (auto page : Slice(vs, 2)) {
                               ^
main.cpp:53:23: error: unable to deduce 'auto&&' from 'page'
     for (auto& word : page) {
                       ^~~~
main.cpp: In function 'void TestConstContainer()':
main.cpp:79:44: error: forming reference to void
   for (const auto& page : Slice(letters, 10)) {
                                            ^
main.cpp: In function 'void TestPagination()':
main.cpp:92:43: error: forming reference to void
   for (const auto& split_by_9 : Slice(v, 9)) {
                                           ^
main.cpp:95:23: error: unable to deduce 'auto&&' from 'split_by_4'
       for (int item : split_by_4) {
                       ^~~~~~~~~~
[печатать | |
]
(1 460 b)
0.115s 0.007s 10