█████████ ████ ███░░░░░███ ░░███ ███ ░░░ ██████ ███████ ██████ ██████ ░███ ███░░███ ███░░███ ███░░███ ███░░███ ░███ ░███ ░███░███ ░███ ░███████ ░███ ░███ ░░███ ███░███ ░███░███ ░███ ░███░░░ ░███ ░███ ░░█████████ ░░██████ ░░████████░░██████ ░░██████ ░░░░░░░░░ ░░░░░░ ░░░░░░░░ ░░░░░░ ░░░░░░

Envío 6871

Problema 0x62 - Contar elementos mayores a X en un arreglo pequeño

  • Autor: Justin
  • Fecha: 2023-02-19 02:01:42 UTC (Hace alrededor de 1 año)
Caso # Resultado Tiempo Memoria
#1
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Error: Could not find or load main class Main
Caused by: java.lang.ClassNotFoundException: Main
0.077 s 14 KBi
#2
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Error: Could not find or load main class Main
Caused by: java.lang.ClassNotFoundException: Main
0.079 s 12 KBi
#3
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Error: Could not find or load main class Main
Caused by: java.lang.ClassNotFoundException: Main
0.076 s 12 KBi
#4
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Error: Could not find or load main class Main
Caused by: java.lang.ClassNotFoundException: Main
0.075 s 12 KBi
#5
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Error: Could not find or load main class Main
Caused by: java.lang.ClassNotFoundException: Main
0.084 s 12 KBi
#6
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Error: Could not find or load main class Main
Caused by: java.lang.ClassNotFoundException: Main
0.074 s 14 KBi
#7
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Error: Could not find or load main class Main
Caused by: java.lang.ClassNotFoundException: Main
0.078 s 12 KBi
#8
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Error: Could not find or load main class Main
Caused by: java.lang.ClassNotFoundException: Main
0.073 s 12 KBi
#9
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Error: Could not find or load main class Main
Caused by: java.lang.ClassNotFoundException: Main
0.1 s 12 KBi
#10
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Error: Could not find or load main class Main
Caused by: java.lang.ClassNotFoundException: Main
0.051 s 15 KBi
Puntos totales: 0 / 100

Código

class CalculoArreglo {
	public static void main(String[] args) {
		
		java.util.Scanner inp = new java.util.Scanner(System.in);
		int n = inp.nextInt();
		
		int numbers[] = new int[n];
		
		for(int i = 0; i < n; i++) {
			numbers[i] = inp.nextInt();
		}
		
		int queries = inp.nextInt();
		
		for(int i = 0; i < queries; i++) {
			int x = inp.nextInt();
			int contador = 0;
			for(int j = 0; j < n; j++) {
				if(numbers[j] > x) contador++;
			}
			System.out.println(contador + "\n");
		}
		
	}
}