#3579
Fie un vector cu n elemente numere naturale. Determinați suma maximă care se poate obține prin adunarea valorilor care nu se află pe poziții consecutive în vector.
| Problema | S_maxim | Operații I/O |
smax.in/smax.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 16 MB
|
| Id soluție | #64274778 | Utilizator | |
| Fișier | s_maxim.cpp | Dimensiune | 535 B |
| Data încărcării | 27 Aprilie 2026, 15:25 | Scor/rezultat | Eroare de compilare |
s_maxim.cpp: In function ‘int main()’: s_maxim.cpp:20:1: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 20 | for(i=1;i<=n;i++) | ^~~ s_maxim.cpp:22:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 22 | fout<<endl; | ^~~~ s_maxim.cpp:23:1: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 23 | for(i=1;i<=n;i++) | ^~~ s_maxim.cpp:25:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 25 | fout<<endl; | ^~~~ s_maxim.cpp:26:1: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 26 | for(i=1;i<=n;i++) | ^~~ s_maxim.cpp:28:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 28 | fout<<endl;*/ | ^~~~ s_maxim.cpp:28:17: error: expected primary-expression before ‘/’ token 28 | fout<<endl;*/ | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema S_maxim 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ă.