Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.276 s | 12 KBi |
#2 |
Correcto
|
0.285 s | 12 KBi |
#3 |
Correcto
|
0.138 s | 12 KBi |
#4 |
Correcto
|
0.135 s | 13 KBi |
#5 |
Correcto
|
0.236 s | 12 KBi |
#6 |
Correcto
|
0.138 s | 12 KBi |
#7 |
Correcto
|
0.156 s | 13 KBi |
#8 |
Correcto
|
0.173 s | 14 KBi |
#9 |
Correcto
|
0.178 s | 13 KBi |
#10 |
Correcto
|
0.33 s | 13 KBi |
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int elementos = sc.nextInt(); int cont; int[] n = new int[elementos]; for (int i = 0; i < n.length; i++) { n[i] = sc.nextInt(); } int consultas = sc.nextInt(); int[] c = new int[consultas]; for (int i = 0; i < c.length; i++) { c[i] = sc.nextInt(); } for (int i = 0; i < c.length; i++) { cont = 0; int actulizar_consultas = c[i]; for (int j = 0; j < n.length; j++) { if (actulizar_consultas < n[j]) { cont++; } } System.out.println(cont); } } }