#3011
lastk
Se dă un șir a[1]
, a[2]
, …, a[n]
de numere naturale și un număr natural k
. Să se determine cele mai mari k
numere din șir.
Folclorul informatic
Problema | lastk | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.5 secunde | Limita memorie |
Total: 2 MB
/
Stivă 1 MB
|
Id soluție | #50141796 | Utilizator | |
Fișier | lastk.cpp | Dimensiune | 2.00 KB |
Data încărcării | 28 Martie 2024, 13:38 | Scor / rezultat | Eroare de compilare |
lastk.cpp: In function 'int main()': lastk.cpp:87:16: error: invalid initialization of reference of type 'int&' from expression of type 'long long int' insert(sz,A); ^ lastk.cpp:44:6: error: in passing argument 1 of 'void insert(int&, int)' void insert(int& n, int val){ ^ lastk.cpp:90:34: error: invalid initialization of reference of type 'int&' from expression of type 'long long int' insert(sz,(B*A + C)%D); ^ lastk.cpp:44:6: error: in passing argument 1 of 'void insert(int&, int)' void insert(int& n, int val){ ^ lastk.cpp:95:31: error: invalid initialization of reference of type 'int&' from expression of type 'long long int' extract_min(sz); ^ lastk.cpp:52:6: error: in passing argument 1 of 'void extract_min(int&)' void extract_min(int& n){ ^ lastk.cpp:96:39: error: invalid initialization of reference of type 'int&' from expression of type 'long long int' insert(sz, (B*A + C)%D); ^ lastk.cpp:44:6: error: in passing argument 1 of 'void insert(int&, int)' void insert(int& n, int val){ ^ lastk.cpp:104:23: error: invalid initialization of reference of type 'int&' from expression of type 'long long int' extract_min(sz); ^ lastk.cpp:52:6: error: in passing argument 1 of 'void extract_min(int&)' void extract_min(int& n){ ^ lastk.cpp:85:34: warning: unused variable 'x' [-Wunused-variable] long long sz = 0,n,k,A,B,C,D,x; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema lastk 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ă.