#4216
Scrieţi definiția completă a subprogramului C++ cu antetul:
int EliminaElemente(int a[], int n, int m)
Subprogramul returnează numărul minim de numere distincte care pot să rămână în a după eliminarea a exact m elemente.
Folclorul informatic
| Problema | EliminaElemente | Operații I/O |
eliminaelemente.in/eliminaelemente.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 32 MB
|
| Id soluție | #59981546 | Utilizator | |
| Fișier | eliminaelemente.cpp | Dimensiune | 640 B |
| Data încărcării | 14 Octombrie 2025, 19:20 | Scor/rezultat | 25 puncte |
eliminaelemente.cpp: In function 'int EliminaElemente(int*, int, int)': eliminaelemente.cpp:27:16: warning: left operand of comma operator has no effect [-Wunused-value] elim[n,v,i]; ^ eliminaelemente.cpp:27:18: warning: right operand of comma operator has no effect [-Wunused-value] elim[n,v,i]; ^ eliminaelemente.cpp:27:19: warning: pointer to a function used in arithmetic [-Wpointer-arith] elim[n,v,i]; ^ eliminaelemente.cpp:27:19: warning: value computed is not used [-Wunused-value] eliminaelemente.cpp:27:19: warning: statement has no effect [-Wunused-value]
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 0 | 0 secunde | Raspuns gresit. | 5 | 0 | ||
| 1 | 0 secunde | OK. | 10 | 10 | ||
| 2 | 0 secunde | Raspuns gresit. | 10 | 0 | ||
| 3 | 0 secunde | OK. | 10 | 10 | ||
| 4 | 0 secunde | Raspuns gresit. | 10 | 0 | ||
| 5 | 0 secunde | Raspuns gresit. | 10 | 0 | ||
| 6 | 0.004 secunde | Raspuns gresit. | 10 | 0 | ||
| 7 | 0.02 secunde | Raspuns gresit. | 10 | 0 | ||
| 8 | 0.048 secunde | Raspuns gresit. | 10 | 0 | ||
| 9 | 0.06 secunde | Raspuns gresit. | 10 | 0 | ||
| 10 | 0 secunde | OK. | 5 | 5 | Exemplu | |
| Punctaj total | 25 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema EliminaElemente 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ă.