#4710
eliminareX
Considerăm şirul numerelor naturale nenule: 1, 2, 3, 4, ...
Din acest şir se elimină N
numere naturale distincte. Trebuie să răspundeţi la Q
întrebări de forma: Pe ce poziţie se află numărul x
în şir după eliminarea celor N
numere?
Problema | eliminareX | Operații I/O |
eliminarex.in /eliminarex.out
|
---|---|---|---|
Limita timp | 0.3 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #53404809 | Utilizator | |
Fișier | eliminarex.cpp | Dimensiune | 750 B |
Data încărcării | 28 Octombrie 2024, 18:00 | Scor / rezultat | Eroare de compilare |
eliminarex.cpp: In function 'int main()': eliminarex.cpp:20:46: error: no matching function for call to 'end(int [(((sizetype)(((ssizetype)N) + -1)) + 1)])' if (find(nbs,nbs+N,question)!=end(nbs)){ ^ eliminarex.cpp:20:46: note: candidates are: In file included from /usr/include/c++/4.8/string:51: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 eliminarex.cpp:1: /usr/include/c++/4.8/bits/range_access.h:68:5: note: template<class _Container> decltype (__cont.end()) std::end(_Container&) end(_Container& __cont) -> decltype(__cont.end()) ^ /usr/include/c++/4.8/bits/range_access.h:68:5: note: template argument deduction/substitution failed: eliminarex.cpp:20:46: note: variable-sized array type 'int [(((sizetype)(((ssizetype)N) + -1)) + 1)]' is not a valid template argument if (find(nbs,nbs+N,question)!=end(nbs)){ ^ In file included from /usr/include/c++/4.8/string:51: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 eliminarex.cpp:1: /usr/include/c++/4.8/bits/range_access.h:78:5: note: template<class _Container> decltype (__cont.end()) std::end(const _Container&) end(const _Container& __cont) -> decltype(__cont.end()) ^ /usr/include/c++/4.8/bits/range_access.h:78:5: note: template argument deduction/substitution failed: eliminarex.cpp:20:46: note: variable-sized array type 'int [(((sizetype)(((ssizetype)N) + -1)) + 1)]' is not a valid template argument if (find(nbs,nbs+N,question)!=end(nbs)){ ^ In file included from /usr/include/c++/4.8/string:51: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 eliminarex.cpp:1: /usr/include/c++/4.8/bits/range_access.h:97:5: note: template<class _Tp, unsigned int _Nm> _Tp* std::end(_Tp (&)[_Nm]) end(_Tp (&__arr)[_Nm]) ^ /usr/include/c++/4.8/bits/range_access.h:97:5: note: template argument deduction/substitution failed: eliminarex.cpp:20:46: note: variable-sized array type 'int [(((sizetype)(((ssizetype)N) + -1)) + 1)]' is not a valid template argument if (find(nbs,nbs+N,question)!=end(nbs)){ ^ In file included from /usr/include/c++/4.8/bits/basic_string.h:42:0, from /usr/include/c++/4.8/string:52, 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 eliminarex.cpp:1: /usr/include/c++/4.8/initializer_list:99:5: note: template<class _Tp> constexpr const _Tp* std::end(std::initializer_list<_Tp>) end(initializer_list<_Tp> __ils) noexcept ^ /usr/include/c++/4.8/initializer_list:99:5: note: template argument deduction/substitution failed: eliminarex.cpp:20:46: note: mismatched types 'std::initializer_list<_Tp>' and 'int*' if (find(nbs,nbs+N,question)!=end(nbs)){ ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema eliminareX 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ă.