#3957
Dându-se un număr natural n
să se afle câte numere se pot obține folosind biții acestuia.
Problema | counterase | Operații I/O |
![]() |
---|---|---|---|
Limita timp | 0.01 secunde | Limita memorie |
Total: 0.1 MB
/
Stivă 0.1 MB
|
Id soluție | #56591427 | Utilizator | |
Fișier | counterase.cpp | Dimensiune | 860 B |
Data încărcării | 26 Februarie 2025, 16:53 | Scor / rezultat | Eroare de compilare |
counterase.cpp: In function 'int countDistinctNumbers(int)': counterase.cpp:11:12: error: missing template arguments before 'bits' bitset bits(n); ^ counterase.cpp:11:12: error: expected ';' before 'bits' counterase.cpp:14:13: error: 'bits' was not declared in this scope if (bits[i]) { ^ counterase.cpp:19:35: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int i = 0; i < ones.size(); ++i) { ^ counterase.cpp:23:16: error: missing template arguments before 'currentBits' bitset currentBits; ^ counterase.cpp:23:16: error: expected ';' before 'currentBits' counterase.cpp:24:39: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int i = 0; i < ones.size(); ++i) { ^ counterase.cpp:25:13: error: 'currentBits' was not declared in this scope currentBits.set(ones[p[i]]); ^ counterase.cpp:27:32: error: 'currentBits' was not declared in this scope distinctNumbers.insert(currentBits.to_ulong()); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema counterase 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ă.