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

Envío 5249

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

  • Autor: dvsalcedo
  • Fecha: 2021-10-30 00:06:59 UTC (Hace más de 2 años)
Caso # Resultado Tiempo Memoria
#1
Error de compilación
                      Main.cs(11,45): error CS0103: The name `ccountQueries' does not exist in the current context
Main.cs(12,25): error CS0019: Operator `<' cannot be applied to operands of type `int' and `string'
Main.cs(20,27): error CS1502: The best overloaded method match for `int.Parse(string)' has some invalid arguments
/usr/local/mono-6.6.0.161/lib/mono/4.5/mscorlib.dll (Location of the symbol related to previous error)
Main.cs(20,40): error CS1503: Argument `#1' cannot convert `int' expression to type `string'
Compilation failed: 4 error(s), 0 warnings

                    
#2
Error de compilación
                      Main.cs(11,45): error CS0103: The name `ccountQueries' does not exist in the current context
Main.cs(12,25): error CS0019: Operator `<' cannot be applied to operands of type `int' and `string'
Main.cs(20,27): error CS1502: The best overloaded method match for `int.Parse(string)' has some invalid arguments
/usr/local/mono-6.6.0.161/lib/mono/4.5/mscorlib.dll (Location of the symbol related to previous error)
Main.cs(20,40): error CS1503: Argument `#1' cannot convert `int' expression to type `string'
Compilation failed: 4 error(s), 0 warnings

                    
#3
Error de compilación
                      Main.cs(11,45): error CS0103: The name `ccountQueries' does not exist in the current context
Main.cs(12,25): error CS0019: Operator `<' cannot be applied to operands of type `int' and `string'
Main.cs(20,27): error CS1502: The best overloaded method match for `int.Parse(string)' has some invalid arguments
/usr/local/mono-6.6.0.161/lib/mono/4.5/mscorlib.dll (Location of the symbol related to previous error)
Main.cs(20,40): error CS1503: Argument `#1' cannot convert `int' expression to type `string'
Compilation failed: 4 error(s), 0 warnings

                    
#4
Error de compilación
                      Main.cs(11,45): error CS0103: The name `ccountQueries' does not exist in the current context
Main.cs(12,25): error CS0019: Operator `<' cannot be applied to operands of type `int' and `string'
Main.cs(20,27): error CS1502: The best overloaded method match for `int.Parse(string)' has some invalid arguments
/usr/local/mono-6.6.0.161/lib/mono/4.5/mscorlib.dll (Location of the symbol related to previous error)
Main.cs(20,40): error CS1503: Argument `#1' cannot convert `int' expression to type `string'
Compilation failed: 4 error(s), 0 warnings

                    
#5
Error de compilación
                      Main.cs(11,45): error CS0103: The name `ccountQueries' does not exist in the current context
Main.cs(12,25): error CS0019: Operator `<' cannot be applied to operands of type `int' and `string'
Main.cs(20,27): error CS1502: The best overloaded method match for `int.Parse(string)' has some invalid arguments
/usr/local/mono-6.6.0.161/lib/mono/4.5/mscorlib.dll (Location of the symbol related to previous error)
Main.cs(20,40): error CS1503: Argument `#1' cannot convert `int' expression to type `string'
Compilation failed: 4 error(s), 0 warnings

                    
#6
Error de compilación
                      Main.cs(11,45): error CS0103: The name `ccountQueries' does not exist in the current context
Main.cs(12,25): error CS0019: Operator `<' cannot be applied to operands of type `int' and `string'
Main.cs(20,27): error CS1502: The best overloaded method match for `int.Parse(string)' has some invalid arguments
/usr/local/mono-6.6.0.161/lib/mono/4.5/mscorlib.dll (Location of the symbol related to previous error)
Main.cs(20,40): error CS1503: Argument `#1' cannot convert `int' expression to type `string'
Compilation failed: 4 error(s), 0 warnings

                    
#7
Error de compilación
                      Main.cs(11,45): error CS0103: The name `ccountQueries' does not exist in the current context
Main.cs(12,25): error CS0019: Operator `<' cannot be applied to operands of type `int' and `string'
Main.cs(20,27): error CS1502: The best overloaded method match for `int.Parse(string)' has some invalid arguments
/usr/local/mono-6.6.0.161/lib/mono/4.5/mscorlib.dll (Location of the symbol related to previous error)
Main.cs(20,40): error CS1503: Argument `#1' cannot convert `int' expression to type `string'
Compilation failed: 4 error(s), 0 warnings

                    
#8
Error de compilación
                      Main.cs(11,45): error CS0103: The name `ccountQueries' does not exist in the current context
Main.cs(12,25): error CS0019: Operator `<' cannot be applied to operands of type `int' and `string'
Main.cs(20,27): error CS1502: The best overloaded method match for `int.Parse(string)' has some invalid arguments
/usr/local/mono-6.6.0.161/lib/mono/4.5/mscorlib.dll (Location of the symbol related to previous error)
Main.cs(20,40): error CS1503: Argument `#1' cannot convert `int' expression to type `string'
Compilation failed: 4 error(s), 0 warnings

                    
#9
Error de compilación
                      Main.cs(11,45): error CS0103: The name `ccountQueries' does not exist in the current context
Main.cs(12,25): error CS0019: Operator `<' cannot be applied to operands of type `int' and `string'
Main.cs(20,27): error CS1502: The best overloaded method match for `int.Parse(string)' has some invalid arguments
/usr/local/mono-6.6.0.161/lib/mono/4.5/mscorlib.dll (Location of the symbol related to previous error)
Main.cs(20,40): error CS1503: Argument `#1' cannot convert `int' expression to type `string'
Compilation failed: 4 error(s), 0 warnings

                    
#10
Error de compilación
                      Main.cs(11,45): error CS0103: The name `ccountQueries' does not exist in the current context
Main.cs(12,25): error CS0019: Operator `<' cannot be applied to operands of type `int' and `string'
Main.cs(20,27): error CS1502: The best overloaded method match for `int.Parse(string)' has some invalid arguments
/usr/local/mono-6.6.0.161/lib/mono/4.5/mscorlib.dll (Location of the symbol related to previous error)
Main.cs(20,40): error CS1503: Argument `#1' cannot convert `int' expression to type `string'
Compilation failed: 4 error(s), 0 warnings

                    
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(ccountQueries)];
        for (var i = 0; i < 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( Int32.Parse(queries[i]) < Int32.Parse(numbers[j]) ) {
                    greaterNumber++;
                }
            }
            Console.WriteLine(greaterNumber);
        }
    }
}