#3944
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_1 | Operații I/O |
turn_1.in/turn_1.out
|
|---|---|---|---|
| Limita timp | 0.2 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #63705988 | Utilizator | |
| Fișier | turn_1.cpp | Dimensiune | 588 B |
| Data încărcării | 16 Martie 2026, 09:51 | Scor/rezultat | Eroare de compilare |
turn_1.cpp: In function 'void afis(int)': turn_1.cpp:10:19: error: cannot bind 'std::ostream {aka std::basic_ostream<char>}' lvalue to 'std::basic_ostream<char>&&' cout<<st[i]; ^ In file included from /usr/include/c++/4.8/iostream:39:0, from turn_1.cpp:1: /usr/include/c++/4.8/ostream:602:5: error: initializing argument 1 of 'std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&&, const _Tp&) [with _CharT = char; _Traits = std::char_traits<char>; _Tp = turn]' operator<<(basic_ostream<_CharT, _Traits>&& __os, const _Tp& __x) ^ turn_1.cpp: In function 'void Back(int)': turn_1.cpp:18:14: error: no match for 'operator=' (operand types are 'turn' and 'int') st[k]=i; ^ turn_1.cpp:18:14: note: candidates are: turn_1.cpp:4:8: note: turn& turn::operator=(const turn&) struct turn{ ^ turn_1.cpp:4:8: note: no known conversion for argument 1 from 'int' to 'const turn&' turn_1.cpp:4:8: note: turn& turn::operator=(turn&&) turn_1.cpp:4:8: note: no known conversion for argument 1 from 'int' to 'turn&&' turn_1.cpp: In function 'int main()': turn_1.cpp:28:10: error: no match for 'operator=' (operand types are 'turn' and 'int') st[0]=0; ^ turn_1.cpp:28:10: note: candidates are: turn_1.cpp:4:8: note: turn& turn::operator=(const turn&) struct turn{ ^ turn_1.cpp:4:8: note: no known conversion for argument 1 from 'int' to 'const turn&' turn_1.cpp:4:8: note: turn& turn::operator=(turn&&) turn_1.cpp:4:8: note: no known conversion for argument 1 from 'int' to 'turn&&'
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema turn_1 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ă.