#1264
StatisticiOrdine
Se dau n
numere naturale. Să se afișeze al k
-lea cel mai mic element din șir.
Problema | StatisticiOrdine | Operații I/O |
![]() statisticiordine.in /statisticiordine.out
|
---|---|---|---|
Limita timp | 1.5 secunde | Limita memorie |
Total: 16 MB
/
Stivă 1 MB
|
Id soluție | #51530635 | Utilizator | |
Fișier | statisticiordine.cpp | Dimensiune | 1.53 KB |
Data încărcării | 05 Iulie 2024, 17:53 | Scor / rezultat | Eroare de compilare |
statisticiordine.cpp:4:16: error: 'vector' has not been declared void merge(vector<int>& nums, int left, int middle, int right){ ^ statisticiordine.cpp:4:22: error: expected ',' or '...' before '<' token void merge(vector<int>& nums, int left, int middle, int right){ ^ statisticiordine.cpp:40:16: error: 'vector' has not been declared void MergeSort(vector<int>& nums, int l, int r){ ^ statisticiordine.cpp:40:22: error: expected ',' or '...' before '<' token void MergeSort(vector<int>& nums, int l, int r){ ^ statisticiordine.cpp:49:24: error: 'vector' has not been declared int findKthLargest(vector<int>& nums, int k) { ^ statisticiordine.cpp:49:30: error: expected ',' or '...' before '<' token int findKthLargest(vector<int>& nums, int k) { ^ statisticiordine.cpp: In member function 'void Solution::merge(int)': statisticiordine.cpp:5:13: error: 'left' was not declared in this scope int i = left; ^ statisticiordine.cpp:6:13: error: 'middle' was not declared in this scope int j = middle + 1; ^ statisticiordine.cpp:9:25: error: 'right' was not declared in this scope int *temp = new int[right - left + 1]; // Dynamically allocate memory ^ statisticiordine.cpp:12:12: error: 'nums' was not declared in this scope if(nums[i] <= nums[j]){ ^ statisticiordine.cpp:23:26: error: 'nums' was not declared in this scope temp[k - left] = nums[i]; ^ statisticiordine.cpp:28:26: error: 'nums' was not declared in this scope temp[k - left] = nums[j]; ^ statisticiordine.cpp:34:9: error: 'nums' was not declared in this scope nums[w] = temp[w - left]; ^ statisticiordine.cpp: In member function 'void Solution::MergeSort(int)': statisticiordine.cpp:41:8: error: 'l' was not declared in this scope if(l < r){ ^ statisticiordine.cpp:41:12: error: 'r' was not declared in this scope if(l < r){ ^ statisticiordine.cpp:43:19: error: 'nums' was not declared in this scope MergeSort(nums, l, m); ^ statisticiordine.cpp: In member function 'int Solution::findKthLargest(int)': statisticiordine.cpp:50:17: error: 'nums' was not declared in this scope int r = nums.size(); ^ statisticiordine.cpp:64:21: error: 'k' was not declared in this scope return nums[k]; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema StatisticiOrdine 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ă.