#1855
Se consideră o colecție de numere naturale, inițial vidă. Asupra ei se fac două tipuri de operații:
1 x
– valoarea x
se adaugă în colecție;2
– cea mai mare valoare din colecție se afișează, apoi se elimină din colecție.Dându-se un șir de m
operații, să se afișeze în ordine rezultatele operațiilor de tip 2
.
Problema | Heap | Operații I/O |
![]() heap.in /heap.out
|
---|---|---|---|
Limita timp | 0.3 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #57218352 | Utilizator | |
Fișier | heap.cpp | Dimensiune | 642 B |
Data încărcării | 20 Martie 2025, 14:13 | Scor / rezultat | Eroare de compilare |
heap.cpp:5:8: error: exponent has no digits int xv(25ee0s].t.m,p; ^ heap.cpp:31:8: warning: missing terminating " character [enabled by default] while(y"2<mp 88 k==-1) ^ heap.cpp:31:1: error: missing terminating " character while(y"2<mp 88 k==-1) ^ heap.cpp:34:10: warning: missing terminating " character [enabled by default] int m-v[y"2]; ^ heap.cpp:34:1: error: missing terminating " character int m-v[y"2]; ^ heap.cpp:37:5: warning: missing terminating " character [enabled by default] mv[y"2+1],k=2; ^ heap.cpp:37:1: error: missing terminating " character mv[y"2+1],k=2; ^ heap.cpp: In function 'int main()': heap.cpp:9:6: error: 'm' was not declared in this scope fin>>m; ^ heap.cpp:10:11: error: 'l' was not declared in this scope for(int i=l;i<-m;++i) ^ heap.cpp:14:5: error: 't' was not declared in this scope fin>t; ^ heap.cpp:18:6: error: expected primary-expression before '%' token fin>>% ^ heap.cpp:19:1: error: expected primary-expression before 'int' int y=p; ^ heap.cpp:19:1: error: expected ';' before 'int' heap.cpp:20:7: error: 'y' was not declared in this scope while(y/2>=1 && v[y/2]<v[y]) ^ heap.cpp:20:17: error: 'v' was not declared in this scope while(y/2>=1 && v[y/2]<v[y]) ^ heap.cpp:21:6: error: 'vty' was not declared in this scope swap(vty/2].v[y]).y-y/2; ^ heap.cpp:21:11: error: expected ';' before ']' token swap(vty/2].v[y]).y-y/2; ^ heap.cpp:27:7: error: 'v' was not declared in this scope fout<<v[1]<<"\n";//COBORARE ^ heap.cpp:28:13: error: 'p' was not declared in this scope swap(v[1],v[p]); ^ heap.cpp:29:3: error: 'P' was not declared in this scope --P; ^ heap.cpp:30:6: error: expected initializer before '-' token int y-l,k=-15 ^ heap.cpp:52:9: error: expected '}' at end of input return 0; ^ heap.cpp:52:9: error: expected '}' at end of input heap.cpp:52:9: error: expected '}' at end of input
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Heap 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ă.