#4092
Se dă n
un număr natural și n
perechi de numere (a, b)
. Să se determine:
a
și b
au număr impar de divizori pozitivi.a
și b
.OJI 2022, Clasa a VI-a, problema de antrenament
Problema | cate | Operații I/O |
![]() cate.in /cate.out
|
---|---|---|---|
Limita timp | 0.2 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #42092315 | Utilizator | |
Fișier | cate.cpp | Dimensiune | 1.48 KB |
Data încărcării | 15 Februarie 2023, 20:52 | Scor / rezultat | Eroare de compilare |
cate.cpp: In function 'int main()': cate.cpp:20:16: error: 'x' was not declared in this scope f>>x>>y; ^ cate.cpp:20:19: error: 'y' was not declared in this scope f>>x>>y; ^ cate.cpp:21:18: error: 'b' was not declared in this scope if(a>b) ^ cate.cpp:23:26: error: 'b' was not declared in this scope g<<(int)sqrt(b)-(int)sqrt(a-1); ^ cate.cpp:23:42: error: no matching function for call to 'sqrt(int*)' g<<(int)sqrt(b)-(int)sqrt(a-1); ^ cate.cpp:23:42: note: candidates are: In file included from /usr/include/features.h:374:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/os_defines.h:39, from /usr/include/i386-linux-gnu/c++/4.8/bits/c++config.h:426, from /usr/include/c++/4.8/iostream:38, from cate.cpp:1: /usr/include/i386-linux-gnu/bits/mathcalls.h:156:1: note: double sqrt(double) __MATHCALL (sqrt,, (_Mdouble_ __x)); ^ /usr/include/i386-linux-gnu/bits/mathcalls.h:156:1: note: no known conversion for argument 1 from 'int*' to 'double' In file included from cate.cpp:3:0: /usr/include/c++/4.8/cmath:494:5: note: template<class _Tp> constexpr typename __gnu_cxx::__enable_if<std::__is_integer<_Tp>::__value, double>::__type std::sqrt(_Tp) sqrt(_Tp __x) ^ /usr/include/c++/4.8/cmath:494:5: note: template argument deduction/substitution failed: /usr/include/c++/4.8/cmath: In substitution of 'template<class _Tp> constexpr typename __gnu_cxx::__enable_if<std::__is_integer<_Tp>::__value, double>::__type std::sqrt(_Tp) [with _Tp = int*]': cate.cpp:23:42: required from here /usr/include/c++/4.8/cmath:494:5: error: no type named '__type' in 'struct __gnu_cxx::__enable_if<false, double>' /usr/include/c++/4.8/cmath:486:3: note: constexpr long double std::sqrt(long double) sqrt(long double __x) ^ /usr/include/c++/4.8/cmath:486:3: note: no known conversion for argument 1 from 'int*' to 'long double' /usr/include/c++/4.8/cmath:482:3: note: constexpr float std::sqrt(float) sqrt(float __x) ^ /usr/include/c++/4.8/cmath:482:3: note: no known conversion for argument 1 from 'int*' to 'float' cate.cpp:40:16: error: cannot bind 'std::basic_istream<char>' lvalue to 'std::basic_istream<char>&&' f>>a>>b; ^ In file included from /usr/include/c++/4.8/iostream:40:0, from cate.cpp:1: /usr/include/c++/4.8/istream:872:5: error: initializing argument 1 of 'std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&&, _Tp&) [with _CharT = char; _Traits = std::char_traits<char>; _Tp = int [100005]]' operator>>(basic_istream<_CharT, _Traits>&& __is, _Tp& __x) ^ cate.cpp:40:19: error: 'b' was not declared in this scope f>>a>>b; ^ cate.cpp:43:26: error: no matching function for call to 'sqrt(int [100005])' int ra=sqrt(a); ^ cate.cpp:43:26: note: candidates are: In file included from /usr/include/features.h:374:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/os_defines.h:39, from /usr/include/i386-linux-gnu/c++/4.8/bits/c++config.h:426, from /usr/include/c++/4.8/iostream:38, from cate.cpp:1: /usr/include/i386-linux-gnu/bits/mathcalls.h:156:1: note: double sqrt(double) __MATHCALL (sqrt,, (_Mdouble_ __x)); ^ /usr/include/i386-linux-gnu/bits/mathcalls.h:156:1: note: no known conversion for argument 1 from 'int [100005]' to 'double' In file included from cate.cpp:3:0: /usr/include/c++/4.8/cmath:494:5: note: template<class _Tp> constexpr typename __gnu_cxx::__enable_if<std::__is_integer<_Tp>::__value, double>::__type std::sqrt(_Tp) sqrt(_Tp __x) ^ /usr/include/c++/4.8/cmath:494:5: note: template argument deduction/substitution failed: /usr/include/c++/4.8/cmath: In substitution of 'template<class _Tp> constexpr typename __gnu_cxx::__enable_if<std::__is_integer<_Tp>::__value, double>::__type std::sqrt(_Tp) [with _Tp = int*]': cate.cpp:43:26: required from here /usr/include/c++/4.8/cmath:494:5: error: no type named '__type' in 'struct __gnu_cxx::__enable_if<false, double>' /usr/include/c++/4.8/cmath:486:3: note: constexpr long double std::sqrt(long double) sqrt(long double __x) ^ /usr/include/c++/4.8/cmath:486:3: note: no known conversion for argument 1 from 'int [100005]' to 'long double' /usr/include/c++/4.8/cmath:482:3: note: constexpr float std::sqrt(float) sqrt(float __x) ^ /usr/include/c++/4.8/cmath:482:3: note: no known conversion for argument 1 from 'int [100005]' to 'float' cate.cpp:45:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] if(ra*ra<a) ra++; ^ cate.cpp:46:16: error: 'prime' was not declared in this scope g<<prime[rb]-prime[ra-1]<<'\n'; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema cate 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ă.