#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 | #64219662 | Utilizator | |
| Fișier | maxsim.cpp | Dimensiune | 533 B |
| Data încărcării | 23 Aprilie 2026, 15:52 | Scor/rezultat | 100 puncte |
maxsim.cpp: In function ‘int main()’: maxsim.cpp:10:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 10 | for(i=1;i<=n;i++) | ^~~ maxsim.cpp:12:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 12 | i=1; | ^ maxsim.cpp:26:29: warning: ‘pozi’ may be used uninitialized [-Wmaybe-uninitialized] 26 | fout<<smaxi<<' '<<pozi<<' '<<pozj; | ^~~ maxsim.cpp:8:35: note: ‘pozi’ was declared here 8 | int n,v[1000],i,j,S=0,smaxi=0,pozi,pozj; | ^~~~ maxsim.cpp:26:34: warning: ‘pozj’ may be used uninitialized [-Wmaybe-uninitialized] 26 | fout<<smaxi<<' '<<pozi<<' '<<pozj; | ^~~~ maxsim.cpp:8:40: note: ‘pozj’ was declared here 8 | int n,v[1000],i,j,S=0,smaxi=0,pozi,pozj; | ^~~~
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.002 secunde | OK. | 20 | 20 | Exemplu | |
| 2 | 0.001 secunde | OK. | 40 | 40 | ||
| 3 | 0.001 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ă.