#298
Se dă un şir format din n elemente, numere naturale. Calculaţi suma elementelor din secvenţa determinată de primul şi ultimul element prim.
| Problema | SumSec | Operații I/O |
sumsec.in/sumsec.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64779447 | Utilizator | |
| Fișier | sumsec.cpp | Dimensiune | 594 B |
| Data încărcării | 30 Mai 2026, 01:15 | Scor/rezultat | 0 puncte |
sumsec.cpp: In function ‘int main()’: sumsec.cpp:8:24: warning: unused variable ‘d’ [-Wunused-variable] 8 | int n, x, l, lmax, d, i, st, dr, cnt = 0, S = 0; | ^ sumsec.cpp:8:27: warning: unused variable ‘i’ [-Wunused-variable] 8 | int n, x, l, lmax, d, i, st, dr, cnt = 0, S = 0; | ^ sumsec.cpp:8:30: warning: unused variable ‘st’ [-Wunused-variable] 8 | int n, x, l, lmax, d, i, st, dr, cnt = 0, S = 0; | ^~ sumsec.cpp:8:34: warning: unused variable ‘dr’ [-Wunused-variable] 8 | int n, x, l, lmax, d, i, st, dr, cnt = 0, S = 0; | ^~ sumsec.cpp:24:5: warning: ‘lmax’ may be used uninitialized [-Wmaybe-uninitialized] 24 | if(l > lmax){ | ^~ sumsec.cpp:8:18: note: ‘lmax’ was declared here 8 | int n, x, l, lmax, d, i, st, dr, cnt = 0, S = 0; | ^~~~
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.001 secunde | Raspuns gresit. | 20 | 0 | Exemplu | |
| 2 | 0.002 secunde | Raspuns gresit. | 40 | 0 | ||
| 3 | 0.001 secunde | Raspuns gresit. | 40 | 0 | ||
| Punctaj total | 0 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema SumSec 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ă.