Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Incorrecto
|
0.077 s | 16 KBi |
#2 |
Incorrecto
|
0.085 s | 16 KBi |
#3 |
Incorrecto
|
0.094 s | 16 KBi |
#4 |
Incorrecto
|
0.095 s | 16 KBi |
#5 |
Incorrecto
|
0.083 s | 16 KBi |
#6 |
Incorrecto
|
0.098 s | 16 KBi |
#7 |
Incorrecto
|
0.108 s | 16 KBi |
#8 |
Incorrecto
|
0.101 s | 17 KBi |
#9 |
Incorrecto
|
0.118 s | 17 KBi |
#10 |
Incorrecto
|
0.121 s | 16 KBi |
import java.util.*; public class Main { public static void main(String[] args) throws java.lang.Exception { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] array= new int[n]; for(int i= 0; i<n; i++){ array[i]=sc.nextInt(); } int s = sc.nextInt(); int[] numbers = new int[s]; for(int i= 0; i<s; i++){ numbers[i]=sc.nextInt(); } getRepetitions(array, numbers); } public static void getRepetitions(int []array, int []numbers){ for(int i=0; i<numbers.length; i++){ int current = numbers[i]; int counter=0; for(int j=0; j<array.length; j++){ counter=0; if(current>array[j]) counter++; } System.out.println(counter); } } // method } //class