#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 |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.5 secunde | Limita memorie |
Total: 2 MB
/
Stivă 1 MB
|
| Id soluție | #56343383 | Utilizator | |
| Fișier | lastk.cpp | Dimensiune | 567 B |
| Data încărcării | 14 Februarie 2025, 14:42 | Scor/rezultat | Eroare de compilare |
lastk.cpp:4:3: error: invalid preprocessing directive #Read # Read input ^ lastk.cpp:7:3: error: invalid preprocessing directive #Initialize # Initialize SortedList with first k elements ^ lastk.cpp:13:3: error: invalid preprocessing directive #Process # Process remaining elements ^ lastk.cpp:16:29: error: stray '#' in program if A > sorted_list[0]: # Replace only if necessary ^ lastk.cpp:17:29: error: stray '#' in program sorted_list.pop(0) # Remove smallest ^ lastk.cpp:18:29: error: stray '#' in program sorted_list.add(A) # Insert new element ^ lastk.cpp:20:3: error: invalid preprocessing directive #Output # Output final sorted result ^ lastk.cpp:1:1: error: 'import' does not name a type import sys ^
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ă.