Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.313 s | 13 KBi |
#2 |
Correcto
|
0.131 s | 14 KBi |
#3 |
Correcto
|
0.161 s | 12 KBi |
#4 |
Correcto
|
0.172 s | 12 KBi |
#5 |
Correcto
|
0.165 s | 12 KBi |
#6 |
Correcto
|
0.131 s | 12 KBi |
#7 |
Correcto
|
0.424 s | 13 KBi |
#8 |
Correcto
|
0.143 s | 12 KBi |
#9 |
Correcto
|
0.199 s | 13 KBi |
#10 |
Correcto
|
0.144 s | 12 KBi |
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); int[] numeros = new int[n]; for (int i = 0; i < n; i++) { numeros[i] = scanner.nextInt(); } int c = scanner.nextInt(); int[] consultas = new int[c]; for (int i = 0; i < c; i++) { consultas[i] = scanner.nextInt(); } int cont; for (int i = 0; i < c; i++) { cont = 0; int consultaActual = consultas[i]; for (int j = 0; j < n; j++) { if(consultaActual < numeros[j]) { cont++; } } System.out.println(cont); } } }