#2285
b2
Fie un număr natural n
, n < 2
62
. Să se afişeze toate numerele naturale mai mici sau egale cu n
, cu proprietatea că reprezentarea lor in baza 2
are exact două cifre 1
.
Problema | b2 | Operații I/O |
b2.in /b2.out
|
---|---|---|---|
Limita timp | 0.2 secunde | Limita memorie |
Total: 4 MB
/
Stivă 4 MB
|
Id soluție | #52939650 | Utilizator | |
Fișier | b2.cpp | Dimensiune | 419 B |
Data încărcării | 13 Octombrie 2024, 19:03 | Scor / rezultat | Eroare de compilare |
b2.cpp: In function 'int main()': b2.cpp:15:7: error: reference to 'count' is ambiguous count = 0; ^ b2.cpp:8:19: note: candidates are: long long int count long long int i,n,count,num; ^ In file included from /usr/include/c++/4.8/algorithm:62:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:64, from b2.cpp:1: /usr/include/c++/4.8/bits/stl_algo.h:4622:5: note: template<class _IIter, class _Tp> typename std::iterator_traits<_Iterator>::difference_type std::count(_IIter, _IIter, const _Tp&) count(_InputIterator __first, _InputIterator __last, const _Tp& __value) ^ b2.cpp:19:11: error: reference to 'count' is ambiguous count=count + num % 2; ^ b2.cpp:8:19: note: candidates are: long long int count long long int i,n,count,num; ^ In file included from /usr/include/c++/4.8/algorithm:62:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:64, from b2.cpp:1: /usr/include/c++/4.8/bits/stl_algo.h:4622:5: note: template<class _IIter, class _Tp> typename std::iterator_traits<_Iterator>::difference_type std::count(_IIter, _IIter, const _Tp&) count(_InputIterator __first, _InputIterator __last, const _Tp& __value) ^ b2.cpp:19:17: error: reference to 'count' is ambiguous count=count + num % 2; ^ b2.cpp:8:19: note: candidates are: long long int count long long int i,n,count,num; ^ In file included from /usr/include/c++/4.8/algorithm:62:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:64, from b2.cpp:1: /usr/include/c++/4.8/bits/stl_algo.h:4622:5: note: template<class _IIter, class _Tp> typename std::iterator_traits<_Iterator>::difference_type std::count(_IIter, _IIter, const _Tp&) count(_InputIterator __first, _InputIterator __last, const _Tp& __value) ^ b2.cpp:22:11: error: reference to 'count' is ambiguous if (count == 2) ^ b2.cpp:8:19: note: candidates are: long long int count long long int i,n,count,num; ^ In file included from /usr/include/c++/4.8/algorithm:62:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:64, from b2.cpp:1: /usr/include/c++/4.8/bits/stl_algo.h:4622:5: note: template<class _IIter, class _Tp> typename std::iterator_traits<_Iterator>::difference_type std::count(_IIter, _IIter, const _Tp&) count(_InputIterator __first, _InputIterator __last, const _Tp& __value) ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema b2 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ă.