#1911
Se dă un vector cu n elemente, numere naturale. Afișați în ordine crescătoare elementele iar după fiecare element, inserați indicele poziției pe care acesta se afla înainte ca vectorul să fie sortat.
| Problema | Sort_Indici | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64955654 | Utilizator | |
| Fișier | sort_indici.cpp | Dimensiune | 561 B |
| Data încărcării | 23 Iunie 2026, 17:35 | Scor/rezultat | Eroare de compilare |
sort_indici.cpp: In function ‘int main()’: sort_indici.cpp:7:9: error: two or more data types in declaration of ‘ciur’ 7 | int | ^~~ sort_indici.cpp:9:5: error: ‘ciur’ was not declared in this scope 9 | ciur[0]=1; | ^~~~ sort_indici.cpp:11:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 11 | for(int i = 2; i * i <= 20000; i++) | ^~~ sort_indici.cpp:15:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 15 | cin >> n; | ^~~ sort_indici.cpp:15:16: error: ‘n’ was not declared in this scope 15 | cin >> n; | ^ sort_indici.cpp:18:16: error: ‘nr’ was not declared in this scope 18 | cin >> nr; | ^~ sort_indici.cpp:19:9: error: ‘vf’ was not declared in this scope 19 | vf[nr]++; | ^~ sort_indici.cpp:25:10: error: ‘v’ was not declared in this scope 25 | if(v[i]>maxx && v[j]<minn) | ^ sort_indici.cpp:25:15: error: ‘maxx’ was not declared in this scope 25 | if(v[i]>maxx && v[j]<minn) | ^~~~ sort_indici.cpp:25:28: error: ‘minn’ was not declared in this scope 25 | if(v[i]>maxx && v[j]<minn) | ^~~~ sort_indici.cpp:31:18: error: expected ‘}’ at end of input 31 | return 0; | ^ sort_indici.cpp:6:11: note: to match this ‘{’ 6 | int main(){ | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Sort_Indici 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ă.