#797
SubNumar
Un număr natural x
, format din exact două cifre, este numit sub-număr al unui număr natural y
dacă cifrele lui x
apar, în aceeași ordine, pe ranguri consecutive, în numărul y
.
Să se determine, pentru mai multe numere date, sub-numerele care apar de cele mai multe ori în scrierea acestora.
Variante Bacalaureat 2014
Problema | SubNumar | Operații I/O |
subnumar.in /subnumar.out
|
---|---|---|---|
Limita timp | 1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54158256 | Utilizator | |
Fișier | subnumar.cpp | Dimensiune | 677 B |
Data încărcării | 20 Noiembrie 2024, 23:47 | Scor / rezultat | Eroare de compilare |
subnumar.cpp: In function 'int main()': subnumar.cpp:12:9: error: reference to 'prev' is ambiguous prev = num % 10; ^ subnumar.cpp:8:21: note: candidates are: int prev int num, max_f = 0, prev, curr, x, i; ^ In file included from /usr/include/c++/4.8/bits/stl_algobase.h:66: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/istream:38, from /usr/include/c++/4.8/sstream:38, from /usr/include/c++/4.8/complex:45, from /usr/include/c++/4.8/ccomplex:38, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52, from subnumar.cpp:1: /usr/include/c++/4.8/bits/stl_iterator_base_funcs.h:193:5: note: template<class _BidirectionalIterator> _BidirectionalIterator std::prev(_BidirectionalIterator, typename std::iterator_traits<_Iter>::difference_type) prev(_BidirectionalIterator __x, typename ^ subnumar.cpp:16:29: error: reference to 'prev' is ambiguous x = curr * 10 + prev; ^ subnumar.cpp:8:21: note: candidates are: int prev int num, max_f = 0, prev, curr, x, i; ^ In file included from /usr/include/c++/4.8/bits/stl_algobase.h:66: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/istream:38, from /usr/include/c++/4.8/sstream:38, from /usr/include/c++/4.8/complex:45, from /usr/include/c++/4.8/ccomplex:38, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52, from subnumar.cpp:1: /usr/include/c++/4.8/bits/stl_iterator_base_funcs.h:193:5: note: template<class _BidirectionalIterator> _BidirectionalIterator std::prev(_BidirectionalIterator, typename std::iterator_traits<_Iter>::difference_type) prev(_BidirectionalIterator __x, typename ^ subnumar.cpp:21:13: error: reference to 'prev' is ambiguous prev = curr; ^ subnumar.cpp:8:21: note: candidates are: int prev int num, max_f = 0, prev, curr, x, i; ^ In file included from /usr/include/c++/4.8/bits/stl_algobase.h:66: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/istream:38, from /usr/include/c++/4.8/sstream:38, from /usr/include/c++/4.8/complex:45, from /usr/include/c++/4.8/ccomplex:38, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52, from subnumar.cpp:1: /usr/include/c++/4.8/bits/stl_iterator_base_funcs.h:193:5: note: template<class _BidirectionalIterator> _BidirectionalIterator std::prev(_BidirectionalIterator, typename std::iterator_traits<_Iter>::difference_type) prev(_BidirectionalIterator __x, typename ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema SubNumar 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ă.