#2276
Se consideră un șir a[1], a[2], …, a[n] de numere naturale. Se dau și T intervale închise de forma [x, y], cu x ≤ y. Pentru fiecare din cele T intervale de forma [x, y] trebuie să răspundeți la întrebarea: câte numere din șir aparțin intervalului [x, y]?
-
| Problema | cb | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64737541 | Utilizator | |
| Fișier | cb.cpp | Dimensiune | 1.23 KB |
| Data încărcării | 26 Mai 2026, 22:20 | Scor/rezultat | 100 puncte |
In function ‘int numara(int, int)’, inlined from ‘int main()’ at cb.cpp:24:28: cb.cpp:35:17: warning: ‘rez’ may be used uninitialized [-Wmaybe-uninitialized] 35 | return pMax - pMin + 1; | ~~~~~^~~~~~ cb.cpp: In function ‘int main()’: cb.cpp:57:22: note: ‘rez’ was declared here 57 | int st, dr, mij, rez; | ^~~ In function ‘int numara(int, int)’, inlined from ‘int main()’ at cb.cpp:24:28: cb.cpp:35:17: warning: ‘rez’ may be used uninitialized [-Wmaybe-uninitialized] 35 | return pMax - pMin + 1; | ~~~~~^~~~~~ cb.cpp: In function ‘int main()’: cb.cpp:39:22: note: ‘rez’ was declared here 39 | int st, dr, mij, rez; | ^~~ cb.cpp: In function ‘int numara(int, int)’: cb.cpp:35:17: warning: ‘rez’ may be used uninitialized [-Wmaybe-uninitialized] 35 | return pMax - pMin + 1; | ~~~~~^~~~~~ cb.cpp:57:22: note: ‘rez’ was declared here 57 | int st, dr, mij, rez; | ^~~ cb.cpp:35:17: warning: ‘rez’ may be used uninitialized [-Wmaybe-uninitialized] 35 | return pMax - pMin + 1; | ~~~~~^~~~~~ cb.cpp:39:22: note: ‘rez’ was declared here 39 | int st, dr, mij, rez; | ^~~ cb.cpp: In function ‘int pozMin(int)’: cb.cpp:53:12: warning: ‘rez’ may be used uninitialized [-Wmaybe-uninitialized] 53 | return rez; | ^~~ cb.cpp:39:22: note: ‘rez’ was declared here 39 | int st, dr, mij, rez; | ^~~ cb.cpp: In function ‘int pozMax(int)’: cb.cpp:75:12: warning: ‘rez’ may be used uninitialized [-Wmaybe-uninitialized] 75 | return rez; | ^~~ cb.cpp:57:22: note: ‘rez’ was declared here 57 | int st, dr, mij, rez; | ^~~
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 0 | 0.001 secunde | OK. | 10 | 10 | ||
| 1 | 0.002 secunde | OK. | 10 | 10 | ||
| 2 | 0.009 secunde | OK. | 10 | 10 | ||
| 3 | 0.02 secunde | OK. | 10 | 10 | ||
| 4 | 0.056 secunde | OK. | 10 | 10 | ||
| 5 | 0.204 secunde | OK. | 10 | 10 | ||
| 6 | 0.217 secunde | OK. | 10 | 10 | ||
| 7 | 0.257 secunde | OK. | 10 | 10 | ||
| 8 | 0.369 secunde | OK. | 10 | 10 | ||
| 9 | 0.418 secunde | OK. | 10 | 10 | ||
| Punctaj total | 100 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema cb 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ă.