#165
Să se determine perechea de elemente dintr-un vector egal depărtate de centru cu suma elementelor maximă.
| Problema | maxsim | Operații I/O |
maxsim.in/maxsim.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64361695 | Utilizator | |
| Fișier | maxsim.cpp | Dimensiune | 379 B |
| Data încărcării | 03 Mai 2026, 11:11 | Scor/rezultat | 100 puncte |
maxsim.cpp: In function ‘int main()’: maxsim.cpp:12:1: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 12 | for(i=1;i<=n/2;i++) | ^~~ maxsim.cpp:19:3: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 19 | fout<<smax<<" "<<x<<" "<<y; | ^~~~ maxsim.cpp:19:23: warning: ‘x’ may be used uninitialized [-Wmaybe-uninitialized] 19 | fout<<smax<<" "<<x<<" "<<y; | ^~~ maxsim.cpp:8:28: note: ‘x’ was declared here 8 | int v[1001], n, i, smax=0, x, y; | ^ maxsim.cpp:19:28: warning: ‘y’ may be used uninitialized [-Wmaybe-uninitialized] 19 | fout<<smax<<" "<<x<<" "<<y; | ^ maxsim.cpp:8:31: note: ‘y’ was declared here 8 | int v[1001], n, i, smax=0, x, y; | ^
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.001 secunde | OK. | 20 | 20 | Exemplu | |
| 2 | 0.002 secunde | OK. | 40 | 40 | ||
| 3 | 0.002 secunde | OK. | 40 | 40 | ||
| Punctaj total | 100 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema maxsim 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ă.