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

Envío 5252

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

  • Autor: dvsalcedo
  • Fecha: 2021-10-30 00:17:27 UTC (Hace más de 2 años)
Caso # Resultado Tiempo Memoria
#1
Incorrecto
0.031 s 3 KBi
#2
Incorrecto
0.026 s 4 KBi
#3
Incorrecto
0.034 s 4 KBi
#4
Incorrecto
0.032 s 3 KBi
#5
Incorrecto
0.034 s 4 KBi
#6
Incorrecto
0.033 s 3 KBi
#7
Incorrecto
0.035 s 3 KBi
#8
Incorrecto
0.03 s 3 KBi
#9
Incorrecto
0.031 s 3 KBi
#10
Incorrecto
0.034 s 3 KBi
Puntos totales: 0 / 100

Código

using System;

public class Program
{
    public static void Main()
    {
        var length = Console.ReadLine();
        var input = Console.ReadLine();
        var numbers = input.Split(' ');
        var countQueries = Console.ReadLine();
        int[] queries = new int[Int32.Parse(countQueries)];
        for (var i = 0; i < Int32.Parse(countQueries); i++) {
            input = Console.ReadLine();
            queries[i] = Int32.Parse(input);
        }

        for ( int i=0; i<Int32.Parse(countQueries) - 1; i++) {
            int greaterNumber = 0;
            for ( int j=0; j<Int32.Parse(length) - 1; j++) {
                if( queries[i] < Int32.Parse(numbers[j]) ) {
                    greaterNumber++;
                }
            }
            Console.WriteLine(greaterNumber);
        }
    }
}