ID 5942986
Пользователь Юрочкин Руслан Викторович
Время 19:44<< 29.12.2021 19:48 (25 д. 19:49) 20:19>>
Обработка 19:48 ... 19:48 (3,83 сек.)
Файл solution.h (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, size_t)':
solution.h:27:27: error: there are no arguments to 'min' that depend on a template parameter, so a declaration of 'min' must be available [-fpermissive]
             size_t temp = min(p_sz, i);
                           ^~~
solution.h:27:27: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
main.cpp: In function 'void TestLooping()':
main.cpp:40:27: error: inconsistent begin/end types in range-based 'for' statement: 'void' and '__gnu_cxx::__normal_iterator<const IteratorRange<__gnu_cxx::__normal_iterator<int*, std::vector<int> > >*, std::vector<IteratorRange<__gnu_cxx::__normal_iterator<int*, std::vector<int> > >, std::allocator<IteratorRange<__gnu_cxx::__normal_iterator<int*, std::vector<int> > > > > >'
   for (const auto& page : slice_v) {
                           ^~~~~~~
main.cpp:40:27: error: 'void __for_begin' 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: inconsistent begin/end types in range-based 'for' statement: 'void' and '__gnu_cxx::__normal_iterator<const IteratorRange<__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > > >*, std::vector<IteratorRange<__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > > >, std::allocator<IteratorRange<__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > > > > > >'
   for (auto page : Slice(vs, 2)) {
                               ^
main.cpp:52:31: error: 'void __for_begin' 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: inconsistent begin/end types in range-based 'for' statement: 'void' and '__gnu_cxx::__normal_iterator<const IteratorRange<__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> > >*, std::vector<IteratorRange<__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> > >, std::allocator<IteratorRange<__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> > > > > >'
   for (const auto& page : letters_slices) {
                           ^~~~~~~~~~~~~~
main.cpp:67:27: error: 'void __for_begin' has incomplete type
main.cpp: In function 'void TestConstContainer()':
main.cpp:79:44: error: inconsistent begin/end types in range-based 'for' statement: 'void' and '__gnu_cxx::__normal_iterator<const IteratorRange<__gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> > >*, std::vector<IteratorRange<__gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> > >, std::allocator<IteratorRange<__gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> > > > > >'
   for (const auto& page : Slice(letters, 10)) {
                                            ^
main.cpp:79:44: error: 'void __for_begin' has incomplete type
main.cpp: In function 'void TestPagination()':
main.cpp:92:43: error: inconsistent begin/end types in range-based 'for' statement: 'void' and '__gnu_cxx::__normal_iterator<const IteratorRange<__gnu_cxx::__normal_iterator<int*, std::vector<int> > >*, std::vector<IteratorRange<__gnu_cxx::__normal_iterator<int*, std::vector<int> > >, std::allocator<IteratorRange<__gnu_cxx::__normal_iterator<int*, std::vector<int> > > > > >'
   for (const auto& split_by_9 : Slice(v, 9)) {
                                           ^
main.cpp:92:43: error: 'void __for_begin' has incomplete type
main.cpp:95:23: error: unable to deduce 'auto&&' from 'split_by_4'
       for (int item : split_by_4) {
                       ^~~~~~~~~~
In file included from main.cpp:1:0:
solution.h: In instantiation of 'Slicer<It>::Slicer(It, It, size_t) [with It = __gnu_cxx::__normal_iterator<int*, std::vector<int> >; size_t = long unsigned int]':
solution.h:48:12:   required from 'auto Slice(C&, size_t) [with C = std::vector<int>; size_t = long unsigned int]'
main.cpp:25:3:   required from here
solution.h:27:30: error: 'min' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
             size_t temp = min(p_sz, i);
                           ~~~^~~~~~~~~
In file included from /usr/include/c++/7/vector:60:0,
                 from solution.h:2,
                 from main.cpp:1:
/usr/include/c++/7/bits/stl_algobase.h:243:5: note: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' declared here, later in the translation unit
     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^~~
In file included from main.cpp:1:0:
solution.h: In instantiation of 'Slicer<It>::Slicer(It, It, size_t) [with It = __gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >; size_t = long unsigned int]':
solution.h:48:12:   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:27:30: error: 'min' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
             size_t temp = min(p_sz, i);
                           ~~~^~~~~~~~~
In file included from /usr/include/c++/7/vector:60:0,
                 from solution.h:2,
                 from main.cpp:1:
/usr/include/c++/7/bits/stl_algobase.h:243:5: note: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' declared here, later in the translation unit
     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^~~
In file included from main.cpp:1:0:
solution.h: In instantiation of 'Slicer<It>::Slicer(It, It, size_t) [with It = __gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >; size_t = long unsigned int]':
main.cpp:65:59:   required from here
solution.h:27:30: error: 'min' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
             size_t temp = min(p_sz, i);
                           ~~~^~~~~~~~~
In file included from /usr/include/c++/7/vector:60:0,
                 from solution.h:2,
                 from main.cpp:1:
/usr/include/c++/7/bits/stl_algobase.h:243:5: note: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' declared here, later in the translation unit
     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^~~
In file included from main.cpp:1:0:
solution.h: In instantiation of 'Slicer<It>::Slicer(It, It, size_t) [with It = __gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> >; size_t = long unsigned int]':
solution.h:48:12:   required from 'auto Slice(C&, size_t) [with C = const std::__cxx11::basic_string<char>; size_t = long unsigned int]'
main.cpp:79:44:   required from here
solution.h:27:30: error: 'min' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
             size_t temp = min(p_sz, i);
                           ~~~^~~~~~~~~
In file included from /usr/include/c++/7/vector:60:0,
                 from solution.h:2,
                 from main.cpp:1:
/usr/include/c++/7/bits/stl_algobase.h:243:5: note: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' declared here, later in the translation unit
     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^~~
0.047s 0.008s 9