#3011
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 |
![]() |
---|---|---|---|
Limita timp | 0.5 secunde | Limita memorie |
Total: 2 MB
/
Stivă 1 MB
|
Id soluție | #56343332 | Utilizator | |
Fișier | lastk.cpp | Dimensiune | 507 B |
Data încărcării | 14 Februarie 2025, 14:39 | Scor / rezultat | Eroare de compilare |
lastk.cpp:4:3: error: invalid preprocessing directive #Fast # Fast input reading ^ lastk.cpp:9:3: error: invalid preprocessing directive #Initialize # Initialize heap with first k elements ^ lastk.cpp:14:3: error: invalid preprocessing directive #Process # Process remaining elements ^ lastk.cpp:17:22: error: stray '#' in program if A > heap[0]: # Only replace if it's greater than the smallest in the heap ^ lastk.cpp:17:42: warning: missing terminating ' character [enabled by default] if A > heap[0]: # Only replace if it's greater than the smallest in the heap ^ lastk.cpp:17:5: error: missing terminating ' character if A > heap[0]: # Only replace if it's greater than the smallest in the heap ^ lastk.cpp:20:3: error: invalid preprocessing directive #Efficient # Efficient output ^ lastk.cpp:1:1: error: 'import' does not name a type import heapq ^
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ă.