ID 5938981
Пользователь Акуленко Валерий Васильевич
Время 27.12.2021 14:16 (23 д. 14:17) 14:17>>
Обработка 14:16 ... 14:16 (4,81 сек.)
Файл 5938981.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 constructor 'Slicer<It>::Slicer(It, It, std::size_t)':
solution.h:30:19: error: there are no arguments to 'ceil' that depend on a template parameter, so a declaration of 'ceil' must be available [-fpermissive]
     slicedPages = ceil((static_cast<double>(std::distance(begin, end)) / pageSize));
                   ^~~~
solution.h:30:19: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
solution.h: In instantiation of 'Slicer<It>::Slicer(It, It, std::size_t) [with It = __gnu_cxx::__normal_iterator<int*, std::vector<int> >; std::size_t = long unsigned int]':
solution.h:73:74:   required from here
solution.h:30:23: error: 'ceil' was not declared in this scope
     slicedPages = ceil((static_cast<double>(std::distance(begin, end)) / pageSize));
                   ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
solution.h: In instantiation of 'Slicer<It>::Slicer(It, It, std::size_t) [with It = __gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >; std::size_t = long unsigned int]':
solution.h:63:10:   required from 'auto Slice(C&, size_t) [with C = std::vector<std::__cxx11::basic_string<char> >; size_t = long unsigned int]'
main.cpp:52:31:   required from here
solution.h:30:23: error: 'ceil' was not declared in this scope
solution.h: In instantiation of 'Slicer<It>::Slicer(It, It, std::size_t) [with It = __gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >; std::size_t = long unsigned int]':
main.cpp:65:59:   required from here
solution.h:30:23: error: 'ceil' was not declared in this scope
solution.h: In instantiation of 'Slicer<It>::Slicer(It, It, std::size_t) [with It = __gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> >; std::size_t = long unsigned int]':
solution.h:68:10:   required from 'auto Slice(const C&, size_t) [with C = std::__cxx11::basic_string<char>; size_t = long unsigned int]'
main.cpp:79:44:   required from here
solution.h:30:23: error: 'ceil' was not declared in this scope
[печатать | |
]
(1 640 b)
0.040s 0.008s 10