#4260
NrXDivImp
C++
Folosind metoda Divide et Impera, scrieți funcția recursivă cu antetul
int NrXDivImp(int a[], int st, int dr, int x)
care primind ca parametri un vector a
de numere întregi și trei numere întregi st
, dr
și x
, returnează numărul de apariții ale numărului x
în vectorul secvența a[st], a[st+1], ..., a[dr]
.
Problema | NrXDivImp | Operații I/O |
nrxdivimp.in /nrxdivimp.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #45365097 | Utilizator | |
Fișier | nrxdivimp.cpp | Dimensiune | 252 B |
Data încărcării | 10 Octombrie 2023, 19:00 | Scor / rezultat | 0 puncte |
nrxdivimp.cpp: In function 'int NrXDivImp(int*, int, int, int)': nrxdivimp.cpp:10:18: warning: left operand of comma operator has no effect [-Wunused-value] int r=(a,st,m,x); ^ nrxdivimp.cpp:10:21: warning: right operand of comma operator has no effect [-Wunused-value] int r=(a,st,m,x); ^ nrxdivimp.cpp:10:23: warning: right operand of comma operator has no effect [-Wunused-value] int r=(a,st,m,x); ^ nrxdivimp.cpp:11:21: warning: left operand of comma operator has no effect [-Wunused-value] int r1=(a,m+1,dr,x); ^ nrxdivimp.cpp:11:20: warning: right operand of comma operator has no effect [-Wunused-value] int r1=(a,m+1,dr,x); ^ nrxdivimp.cpp:11:26: warning: right operand of comma operator has no effect [-Wunused-value] int r1=(a,m+1,dr,x); ^
Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
---|---|---|---|---|---|---|
1 | 0 secunde | Raspuns gresit. | 20 | 0 | ||
2 | 0 secunde | Raspuns gresit. | 20 | 0 | ||
3 | 0 secunde | Raspuns gresit. | 20 | 0 | ||
4 | 0 secunde | Raspuns gresit. | 10 | 0 | ||
5 | 0 secunde | Raspuns gresit. | 10 | 0 | ||
6 | 0 secunde | Raspuns gresit. | 10 | 0 | ||
7 | 0 secunde | Raspuns gresit. | 10 | 0 | ||
Punctaj total | 0 |
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema NrXDivImp face parte din a doua categorie. Pentru aceste probleme se folosește un program suport, furnizat de propunătorul problemei. 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ă.