#3590
Determinați distanța dintre primul bit setat și ultimul bit setat al unui număr natural.
| Problema | bitdistance | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #32147846 | Utilizator | |
| Fișier | bitdistance.cpp | Dimensiune | 566 B |
| Data încărcării | 07 Noiembrie 2021, 18:09 | Scor/rezultat | 100 puncte |
bitdistance.cpp: In function 'long long unsigned int dist(long long unsigned int)': bitdistance.cpp:7:24: warning: variable 'bit' set but not used [-Wunused-but-set-variable] unsigned long long bit, prim, ok=0, ult, k=0; ^ bitdistance.cpp: In function 'int main()': bitdistance.cpp:27:25: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long long unsigned int' [-Wformat=] printf("%d", dist(n)); ^ bitdistance.cpp: In function 'long long unsigned int dist(long long unsigned int)': bitdistance.cpp:21:16: warning: 'ult' may be used uninitialized in this function [-Wmaybe-uninitialized] return ult - prim + 1; ^ bitdistance.cpp:21:25: warning: 'prim' may be used uninitialized in this function [-Wmaybe-uninitialized] return ult - prim + 1; ^ bitdistance.cpp: In function 'int main()': bitdistance.cpp:21:25: warning: 'prim' may be used uninitialized in this function [-Wmaybe-uninitialized] bitdistance.cpp:7:29: note: 'prim' was declared here unsigned long long bit, prim, ok=0, ult, k=0; ^ bitdistance.cpp:21:16: warning: 'ult' may be used uninitialized in this function [-Wmaybe-uninitialized] return ult - prim + 1; ^ bitdistance.cpp:7:41: note: 'ult' was declared here unsigned long long bit, prim, ok=0, ult, k=0; ^
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0 secunde | OK. | 2 | 2 | ||
| 2 | 0 secunde | OK. | 2 | 2 | ||
| 3 | 0 secunde | OK. | 2 | 2 | ||
| 4 | 0 secunde | OK. | 2 | 2 | ||
| 5 | 0 secunde | OK. | 2 | 2 | ||
| 6 | 0 secunde | OK. | 2 | 2 | ||
| 7 | 0 secunde | OK. | 2 | 2 | ||
| 8 | 0 secunde | OK. | 2 | 2 | ||
| 9 | 0 secunde | OK. | 2 | 2 | ||
| 10 | 0 secunde | OK. | 2 | 2 | ||
| 11 | 0 secunde | OK. | 2 | 2 | ||
| 12 | 0 secunde | OK. | 2 | 2 | ||
| 13 | 0 secunde | OK. | 2 | 2 | ||
| 14 | 0 secunde | OK. | 2 | 2 | ||
| 15 | 0 secunde | OK. | 2 | 2 | ||
| 16 | 0 secunde | OK. | 2 | 2 | ||
| 17 | 0 secunde | OK. | 2 | 2 | ||
| 18 | 0 secunde | OK. | 2 | 2 | ||
| 19 | 0 secunde | OK. | 2 | 2 | ||
| 20 | 0 secunde | OK. | 2 | 2 | ||
| 21 | 0 secunde | OK. | 2 | 2 | ||
| 22 | 0 secunde | OK. | 2 | 2 | ||
| 23 | 0 secunde | OK. | 2 | 2 | ||
| 24 | 0 secunde | OK. | 2 | 2 | ||
| 25 | 0 secunde | OK. | 2 | 2 | ||
| 26 | 0 secunde | OK. | 2 | 2 | ||
| 27 | 0 secunde | OK. | 2 | 2 | ||
| 28 | 0 secunde | OK. | 2 | 2 | ||
| 29 | 0 secunde | OK. | 2 | 2 | ||
| 30 | 0 secunde | OK. | 2 | 2 | ||
| 31 | 0 secunde | OK. | 2 | 2 | ||
| 32 | 0 secunde | OK. | 2 | 2 | ||
| 33 | 0 secunde | OK. | 2 | 2 | ||
| 34 | 0 secunde | OK. | 2 | 2 | ||
| 35 | 0 secunde | OK. | 2 | 2 | ||
| 36 | 0 secunde | OK. | 2 | 2 | ||
| 37 | 0 secunde | OK. | 2 | 2 | ||
| 38 | 0 secunde | OK. | 2 | 2 | ||
| 39 | 0 secunde | OK. | 2 | 2 | ||
| 40 | 0 secunde | OK. | 2 | 2 | ||
| 41 | 0 secunde | OK. | 2 | 2 | ||
| 42 | 0 secunde | OK. | 2 | 2 | Exemplu | |
| 43 | 0 secunde | OK. | 2 | 2 | ||
| 44 | 0 secunde | OK. | 2 | 2 | Exemplu | |
| 45 | 0 secunde | OK. | 2 | 2 | ||
| 46 | 0 secunde | OK. | 2 | 2 | ||
| 47 | 0 secunde | OK. | 2 | 2 | ||
| 48 | 0 secunde | OK. | 2 | 2 | ||
| 49 | 0 secunde | OK. | 2 | 2 | ||
| 50 | 0 secunde | OK. | 2 | 2 | ||
| Punctaj total | 100 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema bitdistance 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ă.