#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 | #64569025 | Utilizator | |
| Fișier | maxim6.cpp | Dimensiune | 546 B |
| Data încărcării | 14 Mai 2026, 19:39 | Scor/rezultat | Eroare de compilare |
maxim6.cpp: In function ‘int AlternDivImp(int*, int, int, int)’: maxim6.cpp:13:28: error: too few arguments to function ‘int AlternDivImp(int*, int, int, int)’ 13 | int S1=AlternDivImp(a,st,m); | ~~~~~~~~~~~~^~~~~~~~ maxim6.cpp:6:5: note: declared here 6 | int AlternDivImp(int a[], int st, int dr,int Max){ | ^~~~~~~~~~~~ maxim6.cpp:14:28: error: too few arguments to function ‘int AlternDivImp(int*, int, int, int)’ 14 | int S2=AlternDivImp(a,m+1,dr); | ~~~~~~~~~~~~^~~~~~~~~~ maxim6.cpp:6:5: note: declared here 6 | int AlternDivImp(int a[], int st, int dr,int Max){ | ^~~~~~~~~~~~ maxim6.cpp:8:7: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wdangling-else] 8 | if(st==dr) | ^ maxim6.cpp:21:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 21 | int main() | ^~ maxim6.cpp:21:9: note: remove parentheses to default-initialize a variable 21 | int main() | ^~ | -- maxim6.cpp:21:9: note: or replace parentheses with braces to value-initialize a variable maxim6.cpp:22:1: error: a function-definition is not allowed here before ‘{’ token 22 | { | ^ maxim6.cpp:29:2: error: expected ‘}’ at end of input 29 | } | ^ maxim6.cpp:6:50: note: to match this ‘{’ 6 | int AlternDivImp(int a[], int st, int dr,int Max){ | ^ maxim6.cpp:29:2: warning: control reaches end of non-void function [-Wreturn-type] 29 | } | ^
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ă.