#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 | #54034600 | Utilizator | |
Fișier | statisticiordine.java | Dimensiune | 2.62 KB |
Data încărcării | 18 Noiembrie 2024, 13:04 | Scor / rezultat | Eroare de compilare |
statisticiordine.java:13: error: possible loss of precision long[] array = new long[n]; ^ required: int found: long statisticiordine.java:30: error: possible loss of precision return array[k]; ^ required: int found: long statisticiordine.java:37: error: possible loss of precision return array[left]; ^ required: int found: long statisticiordine.java:46: error: possible loss of precision for (int i = left; i <= right; i += 5) { ^ required: int found: long statisticiordine.java:53: error: possible loss of precision return quickSelect(array, left, (left + (n / 5) - 1), mid); ^ required: int found: long statisticiordine.java:57: error: no suitable method found for sort(long[],long,long) Arrays.sort(array, left, right + 1); ^ method Arrays.<T#1>sort(T#1[],int,int,Comparator<? super T#1>) is not applicable (cannot instantiate from arguments because actual and formal argument lists differ in length) method Arrays.<T#2>sort(T#2[],Comparator<? super T#2>) is not applicable (cannot instantiate from arguments because actual and formal argument lists differ in length) method Arrays.sort(Object[],int,int) is not applicable (actual argument long[] cannot be converted to Object[] by method invocation conversion) method Arrays.sort(Object[]) is not applicable (actual and formal argument lists differ in length) method Arrays.sort(double[],int,int) is not applicable (actual argument long[] cannot be converted to double[] by method invocation conversion) method Arrays.sort(double[]) is not applicable (actual and formal argument lists differ in length) method Arrays.sort(float[],int,int) is not applicable (actual argument long[] cannot be converted to float[] by method invocation conversion) method Arrays.sort(float[]) is not applicable (actual and formal argument lists differ in length) method Arrays.sort(byte[],int,int) is not applicable (actual argument long[] cannot be converted to byte[] by method invocation conversion) method Arrays.sort(byte[]) is not applicable (actual and formal argument lists differ in length) method Arrays.sort(char[],int,int) is not applicable (actual argument long[] cannot be converted to char[] by method invocation conversion) method Arrays.sort(char[]) is not applicable (actual and formal argument lists differ in length) method Arrays.sort(short[],int,int) is not applicable (actual argument long[] cannot be converted to short[] by method invocation conversion) method Arrays.sort(short[]) is not applicable (actual and formal argument lists differ in length) method Arrays.sort(long[],int,int) is not applicable (actual argument long cannot be converted to int by method invocation conversion) method Arrays.sort(long[]) is not applicable (actual and formal argument lists differ in length) method Arrays.sort(int[],int,int) is not applicable (actual argument long[] cannot be converted to int[] by method invocation conversion) method Arrays.sort(int[]) is not applicable (actual and formal argument lists differ in length) where T#1,T#2 are type-variables: T#1 extends Object declared in method <T#1>sort(T#1[],int,int,Comparator<? super T#1>) T#2 extends Object declared in method <T#2>sort(T#2[],Comparator<? super T#2>) statisticiordine.java:58: error: possible loss of precision return (left + right) / 2; ^ required: int found: long statisticiordine.java:62: error: possible loss of precision long pivotValue = array[pivotIndex]; ^ required: int found: long statisticiordine.java:64: error: possible loss of precision int storeIndex = left; ^ required: int found: long statisticiordine.java:66: error: possible loss of precision for (int i = left; i < right; i++) { ^ required: int found: long statisticiordine.java:78: error: possible loss of precision long temp = array[i]; ^ required: int found: long statisticiordine.java:79: error: possible loss of precision array[i] = array[j]; ^ required: int found: long statisticiordine.java:79: error: possible loss of precision array[i] = array[j]; ^ required: int found: long statisticiordine.java:80: error: possible loss of precision array[j] = temp; ^ required: int found: long 14 errors
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ă.