#1156
Se dau înălțimile a n copii, numerotați de la 1 la n, exprimate prin numere naturale. Afișați numerele de ordine ale copiilor în ordinea crescătoare a înălțimii lor.
Pentru sortare se va folosit metoda QuickSort sau MergeSort.
| Problema | InaltimiQ | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64868513 | Utilizator | |
| Fișier | inaltimiq.cpp | Dimensiune | 610 B |
| Data încărcării | 08 Iunie 2026, 15:42 | Scor/rezultat | Eroare de compilare |
inaltimiq.cpp: In function ‘void interclas(int, int, int)’: inaltimiq.cpp:13:13: error: request for member ‘h’ in ‘i’, which is of non-class type ‘int’ 13 | if( v[i.h]<v[j].h) | ^ inaltimiq.cpp:14:9: error: ‘c’ was not declared in this scope 14 | c[k++]=v[i++]; | ^ inaltimiq.cpp:16:9: error: ‘c’ was not declared in this scope 16 | c[k++]=v[j++]; | ^ inaltimiq.cpp:18:9: error: ‘c’ was not declared in this scope 18 | c[k++]=v[i++]; | ^ inaltimiq.cpp:20:9: error: ‘c’ was not declared in this scope 20 | c[k++]=v[j++]; | ^ inaltimiq.cpp:23:18: error: ‘c’ was not declared in this scope 23 | v[i]=c[k++]; | ^ inaltimiq.cpp: In function ‘void merge_sort(int, int)’: inaltimiq.cpp:34:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 34 | int main() | ^~ inaltimiq.cpp:34:9: note: remove parentheses to default-initialize a variable 34 | int main() | ^~ | -- inaltimiq.cpp:34:9: note: or replace parentheses with braces to value-initialize a variable inaltimiq.cpp:35:1: error: a function-definition is not allowed here before ‘{’ token 35 | { | ^ inaltimiq.cpp:37:2: error: expected ‘}’ at end of input 37 | } | ^ inaltimiq.cpp:29:5: note: to match this ‘{’ 29 | { | ^ inaltimiq.cpp:37:2: error: expected ‘}’ at end of input 37 | } | ^ inaltimiq.cpp:27:1: note: to match this ‘{’ 27 | { | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema InaltimiQ 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ă.