Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.125 s | 14 KBi |
#2 |
Correcto
|
0.153 s | 13 KBi |
#3 |
Correcto
|
0.127 s | 14 KBi |
#4 |
Correcto
|
0.136 s | 14 KBi |
#5 |
Correcto
|
0.13 s | 13 KBi |
#6 |
Correcto
|
0.161 s | 13 KBi |
#7 |
Correcto
|
0.153 s | 14 KBi |
#8 |
Correcto
|
0.161 s | 14 KBi |
#9 |
Correcto
|
0.149 s | 14 KBi |
#10 |
Correcto
|
0.165 s | 14 KBi |
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner s = new Scanner(System.in); int n = Integer.parseInt(s.nextLine()); String[] numsS = s.nextLine().split(" "); int[] nums = new int[n]; for (int i = 0; i < n; i++) { nums[i] = Integer.parseInt(numsS[i]); } int q = Integer.parseInt(s.nextLine()); while (q > 0) { int num = Integer.parseInt(s.nextLine()); int count = 0; for (int i : nums) { if (i > num) { count++; } } System.out.println(count); q--; } } }