#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 | #55114775 | Utilizator | |
Fișier | subnumar.cpp | Dimensiune | 745 B |
Data încărcării | 26 Decembrie 2024, 13:48 | Scor / rezultat | Eroare de compilare |
subnumar.cpp: In function 'int main()': subnumar.cpp:15:13: error: 'sp' was not declared in this scope sp[cop % 100]++; ^ subnumar.cpp:20:13: error: 'sp' was not declared in this scope sp[cop % 100]++; ^ subnumar.cpp:26:12: error: 'sp' was not declared in this scope if(sp[i] > max){ ^ subnumar.cpp:26:20: error: reference to 'max' is ambiguous if(sp[i] > max){ ^ subnumar.cpp:8:16: note: candidates are: int max int sn[91], x, max = 9000000, a[91], k = 0; ^ In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0, 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 subnumar.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:260:5: note: template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare) max(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&) max(const _Tp& __a, const _Tp& __b) ^ subnumar.cpp:27:13: error: reference to 'max' is ambiguous max = sp[i]; ^ subnumar.cpp:8:16: note: candidates are: int max int sn[91], x, max = 9000000, a[91], k = 0; ^ In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0, 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 subnumar.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:260:5: note: template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare) max(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&) max(const _Tp& __a, const _Tp& __b) ^ subnumar.cpp:31:26: error: reference to 'max' is ambiguous else if(sp[i] == max){ ^ subnumar.cpp:8:16: note: candidates are: int max int sn[91], x, max = 9000000, a[91], k = 0; ^ In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0, 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 subnumar.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:260:5: note: template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare) max(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&) max(const _Tp& __a, const _Tp& __b) ^
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ă.