#300
Se dă un vector format din n elemente, numere naturale nenule, şi un număr natural S. Determinaţi, dacă există o secvenţă de elemente din şir cu suma elementelor egală cu S.
| Problema | SumaInSecv | Operații I/O |
sumainsecv.in/sumainsecv.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64290353 | Utilizator | |
| Fișier | sumainsecv.cpp | Dimensiune | 457 B |
| Data încărcării | 28 Aprilie 2026, 10:44 | Scor/rezultat | Eroare de compilare |
sumainsecv.cpp: In function ‘int main()’: sumainsecv.cpp:15:12: warning: init-statement in selection statements only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions] 15 | if(j=i+1;j<n;j++) | ^ sumainsecv.cpp:15:21: error: expected ‘)’ before ‘;’ token 15 | if(j=i+1;j<n;j++) | ~ ^ | ) sumainsecv.cpp:15:9: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 15 | if(j=i+1;j<n;j++) | ^~ sumainsecv.cpp:15:22: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 15 | if(j=i+1;j<n;j++) | ^ sumainsecv.cpp:14:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 14 | for(i=1;i<n;i++) | ^~~ sumainsecv.cpp:15:22: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 15 | if(j=i+1;j<n;j++) | ^ sumainsecv.cpp:15:25: error: expected ‘;’ before ‘)’ token 15 | if(j=i+1;j<n;j++) | ^ | ;
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema SumaInSecv 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ă.