#4097
O imprimantă circulară are litere mari ale alfabetului englezesc dispuse circular de la A la Z. Imprimanta are un indicator care inițial este plasat la litera A. Imprimanta tipărește literele în două culori roșu sau albastru. Unele litere se tipăresc cu cerneală roșie, restul cu cerneală albastră. Pentru simplitate le vom numi litere roșii și litere albastre. Fiind date un șir de litere albastre nu neapărat distincte și mulțimea literelor roșii ale imprimantei, să se calculeze:
| Problema | circular1 | Operații I/O |
circular.in/circular.out
|
|---|---|---|---|
| Limita timp | 1 secunde | Limita memorie |
Total: 128 MB
/
Stivă 64 MB
|
| Id soluție | #64332601 | Utilizator | |
| Fișier | circular1.cpp | Dimensiune | 2.61 KB |
| Data încărcării | 30 Aprilie 2026, 09:39 | Scor/rezultat | 100 puncte |
circular1.cpp: In function ‘std::tuple<long long unsigned int, int, char> calc(int, int)’: circular1.cpp:73:19: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 73 | for(int i=0; i<red.size(); i++) | ~^~~~~~~~~~~ circular1.cpp:81:19: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 81 | for(int i=0; i<red.size(); i++) | ~^~~~~~~~~~~ circular1.cpp: In function ‘void cerinta_2()’: circular1.cpp:106:20: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 106 | for(int i=0; i < blue.size() - 1; i++) | ~~^~~~~~~~~~~~~~~~~ In file included from circular1.cpp:6: In constructor ‘constexpr std::_Head_base<_Idx, _Head, false>::_Head_base(_UHead&&) [with _UHead = char&; long unsigned int _Idx = 2; _Head = char]’, inlined from ‘constexpr std::_Tuple_impl<_Idx, _Head>::_Tuple_impl(_UHead&&) [with _UHead = char&; long unsigned int _Idx = 2; _Head = char]’ at /usr/include/c++/13/tuple:514:38, inlined from ‘constexpr std::_Tuple_impl<_Idx, _Head, _Tail ...>::_Tuple_impl(_UHead&&, _UTail&& ...) [with _UHead = int&; _UTail = {char&}; <template-parameter-2-3> = void; long unsigned int _Idx = 1; _Head = int; _Tail = {char}]’ at /usr/include/c++/13/tuple:293:38, inlined from ‘constexpr std::_Tuple_impl<_Idx, _Head, _Tail ...>::_Tuple_impl(_UHead&&, _UTail&& ...) [with _UHead = long long unsigned int&; _UTail = {int&, char&}; <template-parameter-2-3> = void; long unsigned int _Idx = 0; _Head = long long unsigned int; _Tail = {int, char}]’ at /usr/include/c++/13/tuple:293:38, inlined from ‘constexpr std::tuple< <template-parameter-1-1> >::tuple(_UElements&& ...) [with _UElements = {long long unsigned int&, int&, char&}; bool _Valid = true; typename std::enable_if<_TCC<_Valid>::__is_implicitly_constructible<_UElements ...>(), bool>::type <anonymous> = true; _Elements = {long long unsigned int, int, char}]’ at /usr/include/c++/13/tuple:891:54, inlined from ‘constexpr std::tuple<typename std::__strip_reference_wrapper<typename std::decay<_Elements>::type>::__type ...> std::make_tuple(_Elements&& ...) [with _Elements = {long long unsigned int&, int&, char&}]’ at /usr/include/c++/13/tuple:2005:62, inlined from ‘std::tuple<long long unsigned int, int, char> calc(int, int)’ at circular1.cpp:97:52: /usr/include/c++/13/tuple:201:11: warning: ‘litera’ may be used uninitialized [-Wmaybe-uninitialized] 201 | : _M_head_impl(std::forward<_UHead>(__h)) { } | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ circular1.cpp: In function ‘std::tuple<long long unsigned int, int, char> calc(int, int)’: circular1.cpp:70:10: note: ‘litera’ was declared here 70 | char litera; | ^~~~~~
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.002 secunde | OK. | 4 | 4 | ||
| 2 | 0.001 secunde | OK. | 4 | 4 | ||
| 3 | 0.002 secunde | OK. | 4 | 4 | ||
| 4 | 0.002 secunde | OK. | 4 | 4 | ||
| 5 | 0.001 secunde | OK. | 4 | 4 | ||
| 6 | 0.001 secunde | OK. | 4 | 4 | ||
| 7 | 0.001 secunde | OK. | 4 | 4 | ||
| 8 | 0.001 secunde | OK. | 4 | 4 | ||
| 9 | 0.001 secunde | OK. | 4 | 4 | ||
| 10 | 0.002 secunde | OK. | 4 | 4 | ||
| 11 | 0.003 secunde | OK. | 4 | 4 | ||
| 12 | 0.002 secunde | OK. | 4 | 4 | ||
| 13 | 0.002 secunde | OK. | 4 | 4 | ||
| 14 | 0.004 secunde | OK. | 4 | 4 | ||
| 15 | 0.001 secunde | OK. | 4 | 4 | ||
| 16 | 0.002 secunde | OK. | 4 | 4 | ||
| 17 | 0.001 secunde | OK. | 4 | 4 | ||
| 18 | 0.001 secunde | OK. | 4 | 4 | ||
| 19 | 0.002 secunde | OK. | 4 | 4 | ||
| 20 | 0.001 secunde | OK. | 4 | 4 | ||
| 21 | 0.001 secunde | OK. | 4 | 4 | ||
| 22 | 0.003 secunde | OK. | 4 | 4 | ||
| 23 | 0.002 secunde | OK. | 4 | 4 | ||
| 24 | 0.004 secunde | OK. | 4 | 4 | ||
| 25 | 0.002 secunde | OK. | 4 | 4 | ||
| Punctaj total | 100 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema circular1 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ă.