#1050
TCIF
Avem la dispoziţie patru numere naturale N
, A
, B
, C
, precum şi trei cifre c1
, c2
, c3
distincte două câte două.
Să se determine numărul natural minim, strict mai mare decât N
, care are exact A
cifre c1
, B
cifre c2
, C
cifre c3
şi nu conţine alte cifre.
OJI 2014, Clasa a VIII-a
Problema | TCIF | Operații I/O |
tcif.in /tcif.out
|
---|---|---|---|
Limita timp | 0.5 secunde | Limita memorie |
Total: 2 MB
/
Stivă 1 MB
|
Id soluție | #53691879 | Utilizator | |
Fișier | tcif.cpp | Dimensiune | 1.11 KB |
Data încărcării | 08 Noiembrie 2024, 16:15 | Scor / rezultat | Eroare de compilare |
tcif.cpp: In function 'int main()': tcif.cpp:37:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(i=0;i<n.size();i++) ^ tcif.cpp:39:9: error: 'a' was not declared in this scope a[i]=n[i]-'0'; ^ tcif.cpp:43:45: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if(v[1].cate+v[3].cate+v[2].cate>n.size()) ^ tcif.cpp:60:9: error: 'ok' was not declared in this scope ok=0; ^ tcif.cpp:62:25: error: no match for 'operator>' (operand types are 'std::string {aka std::basic_string<char>}' and 'int') while(ok==0 && n>i && (k=alegecifre(t[i])) ) ^ tcif.cpp:62:25: note: candidates are: In file included from /usr/include/c++/4.8/bits/stl_algobase.h:64: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 tcif.cpp:1: /usr/include/c++/4.8/bits/stl_pair.h:233:5: note: template<class _T1, class _T2> constexpr bool std::operator>(const std::pair<_T1, _T2>&, const std::pair<_T1, _T2>&) operator>(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) ^ /usr/include/c++/4.8/bits/stl_pair.h:233:5: note: template argument deduction/substitution failed: tcif.cpp:62:26: note: 'std::string {aka std::basic_string<char>}' is not derived from 'const std::pair<_T1, _T2>' while(ok==0 && n>i && (k=alegecifre(t[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 tcif.cpp:1: /usr/include/c++/4.8/bits/stl_iterator.h:309:5: note: template<class _Iterator> bool 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:309:5: note: template argument deduction/substitution failed: tcif.cpp:62:26: note: 'std::string {aka std::basic_string<char>}' is not derived from 'const std::reverse_iterator<_Iterator>' while(ok==0 && n>i && (k=alegecifre(t[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 tcif.cpp:1: /usr/include/c++/4.8/bits/stl_iterator.h:359:5: note: template<class _IteratorL, class _IteratorR> bool 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:359:5: note: template argument deduction/substitution failed: tcif.cpp:62:26: note: 'std::string {aka std::basic_string<char>}' is not derived from 'const std::reverse_iterator<_Iterator>' while(ok==0 && n>i && (k=alegecifre(t[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 tcif.cpp:1: /usr/include/c++/4.8/bits/stl_iterator.h:1079:5: note: template<class _IteratorL, class _IteratorR> bool 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:1079:5: note: template argument deduction/substitution failed: tcif.cpp:62:26: note: 'std::string {aka std::basic_string<char>}' is not derived from 'const std::move_iterator<_Iterator>' while(ok==0 && n>i && (k=alegecifre(t[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 tcif.cpp:1: /usr/include/c++/4.8/bits/stl_iterator.h:1085:5: note: template<class _Iterator> bool 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:1085:5: note: template argument deduction/substitution failed: tcif.cpp:62:26: note: 'std::string {aka std::basic_string<char>}' is not derived from 'const std::move_iterator<_Iterator>' while(ok==0 && n>i && (k=alegecifre(t[i])) ) ^ In file included from /usr/include/c++/4.8/string:52:0, from /usr/include/c++/4.8/bits/locale_classes.h:40, from /usr/include/c++/4.8/bits/ios_base.h:41, from /usr/include/c++/4.8/ios:42, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from tcif.cpp:1: /usr/include/c++/4.8/bits/basic_string.h:2606:5: note: template<class _CharT, class _Traits, class _Alloc> bool std::operator>(const std::basic_string<_CharT, _Traits, _Alloc>&, const std::basic_string<_CharT, _Traits, _Alloc>&) operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs, ^ /usr/include/c++/4.8/bits/basic_string.h:2606:5: note: template argument deduction/substitution failed: tcif.cpp:62:26: note: mismatched types 'const std::basic_string<_CharT, _Traits, _Alloc>' and 'int' while(ok==0 && n>i && (k=alegecifre(t[i])) ) ^ In file included from /usr/include/c++/4.8/string:52:0, from /usr/include/c++/4.8/bits/locale_classes.h:40, from /usr/include/c++/4.8/bits/ios_base.h:41, from /usr/include/c++/4.8/ios:42, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from tcif.cpp:1: /usr/include/c++/4.8/bits/basic_string.h:2618:5: note: template<class _CharT, class _Traits, class _Alloc> bool std::operator>(const std::basic_string<_CharT, _Traits, _Alloc>&, const _CharT*) operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs, ^ /usr/include/c++/4.8/bits/basic_string.h:2618:5: note: template argument deduction/substitution failed: tcif.cpp:62:26: note: mismatched types 'const _CharT*' and 'int' while(ok==0 && n>i && (k=alegecifre(t[i])) ) ^ In file included from /usr/include/c++/4.8/string:52:0, from /usr/include/c++/4.8/bits/locale_classes.h:40, from /usr/include/c++/4.8/bits/ios_base.h:41, from /usr/include/c++/4.8/ios:42, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from tcif.cpp:1: /usr/include/c++/4.8/bits/basic_string.h:2630:5: note: template<class _CharT, class _Traits, class _Alloc> bool std::operator>(const _CharT*, const std::basic_string<_CharT, _Traits, _Alloc>&) operator>(const _CharT* __lhs, ^ /usr/include/c++/4.8/bits/basic_string.h:2630:5: note: template argument deduction/substitution failed: tcif.cpp:62:26: note: mismatched types 'const _CharT*' and 'std::basic_string<char>' while(ok==0 && n>i && (k=alegecifre(t[i])) ) ^ In file included from /usr/include/c++/4.8/vector:64: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 tcif.cpp:2: /usr/include/c++/4.8/bits/stl_vector.h:1434:5: note: template<class _Tp, class _Alloc> bool std::operator>(const std::vector<_Tp, _Alloc>&, const std::vector<_Tp, _Alloc>&) operator>(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y) ^ /usr/include/c++/4.8/bits/stl_vector.h:1434:5: note: template argument deduction/substitution failed: tcif.cpp:62:26: note: 'std::string {aka std::basic_string<char>}' is not derived from 'const std::vector<_Tp, _Alloc>' while(ok==0 && n>i && (k=alegecifre(t[i])) ) ^ In file included from /usr/include/c++/4.8/tuple:39:0, from /usr/include/c++/4.8/functional:55, from /usr/include/c++/4.8/bits/stl_algo.h:66, from /usr/include/c++/4.8/algorithm:62, from tcif.cpp:2: /usr/include/c++/4.8/array:246:5: note: template<class _Tp, unsigned int _Nm> bool std::operator>(const std::array<_Tp, _Nm>&, const std::array<_Tp, _Nm>&) operator>(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two) ^ /usr/include/c++/4.8/array:246:5: note: template argument deduction/substitution failed: tcif.cpp:62:26: note: 'std::string {aka std::basic_string<char>}' is not derived from 'const std::array<_Tp, _Nm>' while(ok==0 && n>i && (k=alegecifre(t[i])) ) ^ In file included from /usr/include/c++/4.8/functional:55:0, from /usr/include/c++/4.8/bits/stl_algo.h:66, from /usr/include/c++/4.8/algorithm:62, from tcif.cpp:2: /usr/include/c++/4.8/tuple:841:5: note: template<class ... _TElements, class ... _UElements> constexpr bool std::operator>(const std::tuple<_Elements ...>&, const std::tuple<_Elements ...>&) operator>(const tuple<_TElements...>& __t, ^ /usr/include/c++/4.8/tuple:841:5: note: template argument deduction/substitution failed: tcif.cpp:62:26: note: 'std::string {aka std::basic_string<char>}' is not derived from 'const std::tuple<_Elements ...>' while(ok==0 && n>i && (k=alegecifre(t[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 tcif.cpp:1: /usr/include/c++/4.8/bits/stl_iterator.h:848:5: note: template<class _Iterator, class _Container> bool __gnu_cxx::operator>(const __gnu_cxx::__normal_iterator<_Iterator, _Container>&, const __gnu_cxx::__normal_iterator<_Iterator, _Container>&) operator>(const __normal_iterator<_Iterator, _Container>& __lhs, ^ /usr/include/c++/4.8/bits/stl_iterator.h:848:5: note: template argument deduction/substitution failed: tcif.cpp:62:26: note: 'std::string {aka std::basic_string<char>}' is not derived from 'const __gnu_cxx::__normal_iterator<_Iterator, _Container>' while(ok==0 && n>i && (k=alegecifre(t[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 tcif.cpp:1: /usr/include/c++/4.8/bits/stl_iterator.h:842:5: note: template<class _IteratorL, class _IteratorR, class _Container> bool __gnu_cxx::operator>(const __gnu_cxx::__normal_iterator<_IteratorL, _Container>&, const __gnu_cxx::__normal_iterator<_IteratorR, _Container>&) operator>(const __normal_iterator<_IteratorL, _Container>& __lhs, ^ /usr/include/c++/4.8/bits/stl_iterator.h:842:5: note: template argument deduction/substitution failed: tcif.cpp:62:26: note: 'std::string {aka std::basic_string<char>}' is not derived from 'const __gnu_cxx::__normal_iterator<_IteratorL, _Container>' while(ok==0 && n>i && (k=alegecifre(t[i])) ) ^ tcif.cpp:62:32: error: 'k' was not declared in this scope while(ok==0 && n>i && (k=alegecifre(t[i])) ) ^ tcif.cpp:62:45: error: 't' was not declared in this scope while(ok==0 && n>i && (k=alegecifre(t[i])) ) ^ tcif.cpp:63:5: error: expected primary-expression before '}' token } ^ tcif.cpp:63:5: error: expected ';' before '}' token tcif.cpp: In function 'int alegecifre(int)': tcif.cpp:23:1: warning: control reaches end of non-void function [-Wreturn-type] } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema TCIF 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ă.