#1019
Se consideră un șir cu n elemente, numere naturale. Folosind metoda Divide et Impera, determinați cel mai mare element din acest șir.
| Problema | Maxim6 | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64109833 | Utilizator | |
| Fișier | maxim6.cpp | Dimensiune | 433 B |
| Data încărcării | 17 Aprilie 2026, 13:12 | Scor/rezultat | Eroare de compilare |
maxim6.cpp: In function ‘bool divi(int, int, int)’: maxim6.cpp:9:21: error: invalid types ‘int[int]’ for array subscript 9 | return max(a[st],a[dr]); | ^ maxim6.cpp:9:27: error: invalid types ‘int[int]’ for array subscript 9 | return max(a[st],a[dr]); | ^ maxim6.cpp:11:13: warning: unused variable ‘m’ [-Wunused-variable] 11 | int m=(st+dr)/2; | ^ maxim6.cpp:10:5: warning: this ‘else’ clause does not guard... [-Wmisleading-indentation] 10 | else | ^~~~ maxim6.cpp:12:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘else’ 12 | int rez1,rez2; | ^~~ maxim6.cpp:13:22: error: ‘m’ was not declared in this scope 13 | rez1=divi(st,m); | ^ maxim6.cpp: In function ‘int main()’: maxim6.cpp:25:15: error: too few arguments to function ‘bool divi(int, int, int)’ 25 | cout<<divi(1,n); | ~~~~^~~~~ maxim6.cpp:6:6: note: declared here 6 | bool divi(int st, int dr, int a) | ^~~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Maxim6 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ă.