#2261
turn
n
cuburi numerotate de la 1
la n
pentru care se cunosc latura și culoarea. Să se genereze toate turnurile de înălțime H
ce se pot forma cu cele n
cuburi, astfel încât fiecare turn să respecte următoarele condiții:
Problema | turn | Operații I/O |
turn.in /turn.out
|
---|---|---|---|
Limita timp | 0.2 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #53850092 | Utilizator | |
Fișier | turn.cpp | Dimensiune | 1.31 KB |
Data încărcării | 13 Noiembrie 2024, 10:08 | Scor / rezultat | Eroare de compilare |
turn.cpp: In function 'void bt(int)': turn.cpp:40:23: error: no match for 'operator-' (operand types are 'ind' and 'int') for(int i = x[k-1]-1; i >= 1; i--) ^ turn.cpp:40:23: note: candidates are: In file included from /usr/include/c++/4.8/bits/stl_algobase.h:67:0, from /usr/include/c++/4.8/bits/char_traits.h:39, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from turn.cpp:1: /usr/include/c++/4.8/bits/stl_iterator.h:327:5: note: template<class _Iterator> typename std::reverse_iterator<_Iterator>::difference_type std::operator-(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_Iterator>&) operator-(const reverse_iterator<_Iterator>& __x, ^ /usr/include/c++/4.8/bits/stl_iterator.h:327:5: note: template argument deduction/substitution failed: turn.cpp:40:24: note: 'ind' is not derived from 'const std::reverse_iterator<_Iterator>' for(int i = x[k-1]-1; i >= 1; i--) ^ In file included from /usr/include/c++/4.8/bits/stl_algobase.h:67:0, from /usr/include/c++/4.8/bits/char_traits.h:39, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from turn.cpp:1: /usr/include/c++/4.8/bits/stl_iterator.h:379:5: note: template<class _IteratorL, class _IteratorR> decltype ((__y.base() - __x.base())) std::operator-(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_IteratorR>&) operator-(const reverse_iterator<_IteratorL>& __x, ^ /usr/include/c++/4.8/bits/stl_iterator.h:379:5: note: template argument deduction/substitution failed: turn.cpp:40:24: note: 'ind' is not derived from 'const std::reverse_iterator<_Iterator>' for(int i = x[k-1]-1; i >= 1; i--) ^ In file included from /usr/include/c++/4.8/bits/stl_algobase.h:67:0, from /usr/include/c++/4.8/bits/char_traits.h:39, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from turn.cpp:1: /usr/include/c++/4.8/bits/stl_iterator.h:1104:5: note: template<class _IteratorL, class _IteratorR> decltype ((__x.base() - __y.base())) std::operator-(const std::move_iterator<_Iterator>&, const std::move_iterator<_IteratorR>&) operator-(const move_iterator<_IteratorL>& __x, ^ /usr/include/c++/4.8/bits/stl_iterator.h:1104:5: note: template argument deduction/substitution failed: turn.cpp:40:24: note: 'ind' is not derived from 'const std::move_iterator<_Iterator>' for(int i = x[k-1]-1; i >= 1; i--) ^ In file included from /usr/include/c++/4.8/bits/stl_algobase.h:67:0, from /usr/include/c++/4.8/bits/char_traits.h:39, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from turn.cpp:1: /usr/include/c++/4.8/bits/stl_iterator.h:1111:5: note: template<class _Iterator> decltype ((__x.base() - __y.base())) std::operator-(const std::move_iterator<_Iterator>&, const std::move_iterator<_Iterator>&) operator-(const move_iterator<_Iterator>& __x, ^ /usr/include/c++/4.8/bits/stl_iterator.h:1111:5: note: template argument deduction/substitution failed: turn.cpp:40:24: note: 'ind' is not derived from 'const std::move_iterator<_Iterator>' for(int i = x[k-1]-1; i >= 1; i--) ^ In file included from /usr/include/c++/4.8/vector:65:0, from /usr/include/c++/4.8/bits/random.h:34, from /usr/include/c++/4.8/random:50, from /usr/include/c++/4.8/bits/stl_algo.h:65, from /usr/include/c++/4.8/algorithm:62, from turn.cpp:3: /usr/include/c++/4.8/bits/stl_bvector.h:208:3: note: std::ptrdiff_t std::operator-(const std::_Bit_iterator_base&, const std::_Bit_iterator_base&) operator-(const _Bit_iterator_base& __x, const _Bit_iterator_base& __y) ^ /usr/include/c++/4.8/bits/stl_bvector.h:208:3: note: no known conversion for argument 1 from 'ind' to 'const std::_Bit_iterator_base&' turn.cpp: In function 'int main()': turn.cpp:69:9: error: no match for 'operator=' (operand types are 'ind' and 'int') x[0]=n+1; ^ turn.cpp:69:9: note: candidates are: turn.cpp:10:8: note: ind& ind::operator=(const ind&) struct ind{ ^ turn.cpp:10:8: note: no known conversion for argument 1 from 'int' to 'const ind&' turn.cpp:10:8: note: ind& ind::operator=(ind&&) turn.cpp:10:8: note: no known conversion for argument 1 from 'int' to 'ind&&'
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema turn face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:
Suma punctajelor acordate pe testele utilizate pentru verificare este 100. Astfel, soluția ta poate obține cel mult 100 de puncte, caz în care se poate considera corectă.