#1149
Se dă un şir cu n elemente, numere naturale. Folosind metoda Divide et Impera să se verifice dacă în șir există elemente prime.
| Problema | ExistaPrimeDivImp | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64746685 | Utilizator | |
| Fișier | existaprimedivimp.cpp | Dimensiune | 451 B |
| Data încărcării | 27 Mai 2026, 14:26 | Scor/rezultat | Eroare de compilare |
existaprimedivimp.cpp: In function ‘int divimp(int, int)’: existaprimedivimp.cpp:20:18: warning: pointer to a function used in arithmetic [-Wpointer-arith] 20 | if(prim[s]) | ^ existaprimedivimp.cpp:20:18: warning: comparing the result of pointer addition ‘(prim + ((sizetype)s))’ and NULL [-Waddress] existaprimedivimp.cpp:26:23: error: ‘v’ was not declared in this scope 26 | return divimp(v,s,(s+d)/2) || divimp(v,s+d/2+1,d); | ^ existaprimedivimp.cpp: In function ‘int prim(int)’: existaprimedivimp.cpp:15:1: warning: control reaches end of non-void function [-Wreturn-type] 15 | } | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema ExistaPrimeDivImp 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ă.