#1020
Se consideră un șir cu n elemente, numere naturale. Folosind metoda Divide et Impera, determinați cel mai mare element prim din acest șir.
| Problema | MaxPrim | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64449029 | Utilizator | |
| Fișier | maxprim.cpp | Dimensiune | 800 B |
| Data încărcării | 07 Mai 2026, 13:45 | Scor/rezultat | Eroare de compilare |
maxprim.cpp: In function ‘int main()’: maxprim.cpp:4:18: error: a function-definition is not allowed here before ‘{’ token 4 | bool prim(int x) { | ^ maxprim.cpp:21:40: error: a function-definition is not allowed here before ‘{’ token 21 | int maximPrim(int v[], int st, int dr) { | ^ maxprim.cpp:35:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 35 | int main() { | ^~ maxprim.cpp:35:9: note: remove parentheses to default-initialize a variable 35 | int main() { | ^~ | -- maxprim.cpp:35:9: note: or replace parentheses with braces to value-initialize a variable maxprim.cpp:35:12: error: a function-definition is not allowed here before ‘{’ token 35 | int main() { | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema MaxPrim 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ă.