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

Envío 481

Problema 0x9d - ¿Está ordenado?

  • Autor: Andres Ariza
  • Fecha: 2020-09-06 16:34:20 UTC (Hace más de 3 años)
Caso # Resultado Tiempo Memoria
#1
Error de compilación
                      main.c:1:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
num_elements = int(input())
^
main.c:1:16: error: expected expression
num_elements = int(input())
               ^
main.c:12:14: error: expected ';' after top level declarator
        break
             ^
             ;
1 warning and 2 errors generated.

                    
#2
Error de compilación
                      main.c:1:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
num_elements = int(input())
^
main.c:1:16: error: expected expression
num_elements = int(input())
               ^
main.c:12:14: error: expected ';' after top level declarator
        break
             ^
             ;
1 warning and 2 errors generated.

                    
#3
Error de compilación
                      main.c:1:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
num_elements = int(input())
^
main.c:1:16: error: expected expression
num_elements = int(input())
               ^
main.c:12:14: error: expected ';' after top level declarator
        break
             ^
             ;
1 warning and 2 errors generated.

                    
#4
Error de compilación
                      main.c:1:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
num_elements = int(input())
^
main.c:1:16: error: expected expression
num_elements = int(input())
               ^
main.c:12:14: error: expected ';' after top level declarator
        break
             ^
             ;
1 warning and 2 errors generated.

                    
#5
Error de compilación
                      main.c:1:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
num_elements = int(input())
^
main.c:1:16: error: expected expression
num_elements = int(input())
               ^
main.c:12:14: error: expected ';' after top level declarator
        break
             ^
             ;
1 warning and 2 errors generated.

                    
#6
Error de compilación
                      main.c:1:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
num_elements = int(input())
^
main.c:1:16: error: expected expression
num_elements = int(input())
               ^
main.c:12:14: error: expected ';' after top level declarator
        break
             ^
             ;
1 warning and 2 errors generated.

                    
#7
Error de compilación
                      main.c:1:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
num_elements = int(input())
^
main.c:1:16: error: expected expression
num_elements = int(input())
               ^
main.c:12:14: error: expected ';' after top level declarator
        break
             ^
             ;
1 warning and 2 errors generated.

                    
#8
Error de compilación
                      main.c:1:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
num_elements = int(input())
^
main.c:1:16: error: expected expression
num_elements = int(input())
               ^
main.c:12:14: error: expected ';' after top level declarator
        break
             ^
             ;
1 warning and 2 errors generated.

                    
#9
Error de compilación
                      main.c:1:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
num_elements = int(input())
^
main.c:1:16: error: expected expression
num_elements = int(input())
               ^
main.c:12:14: error: expected ';' after top level declarator
        break
             ^
             ;
1 warning and 2 errors generated.

                    
#10
Error de compilación
                      main.c:1:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
num_elements = int(input())
^
main.c:1:16: error: expected expression
num_elements = int(input())
               ^
main.c:12:14: error: expected ';' after top level declarator
        break
             ^
             ;
1 warning and 2 errors generated.

                    
#11
Error de compilación
                      main.c:1:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
num_elements = int(input())
^
main.c:1:16: error: expected expression
num_elements = int(input())
               ^
main.c:12:14: error: expected ';' after top level declarator
        break
             ^
             ;
1 warning and 2 errors generated.

                    
#12
Error de compilación
                      main.c:1:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
num_elements = int(input())
^
main.c:1:16: error: expected expression
num_elements = int(input())
               ^
main.c:12:14: error: expected ';' after top level declarator
        break
             ^
             ;
1 warning and 2 errors generated.

                    
Puntos totales: 0 / 100

Código

num_elements = int(input())
array = input()
arr = [eval(num) for num in array.split()]
for idx in range(num_elements):
    if idx == num_elements - 1:
        print("Ordenado")
        break
    if arr[idx] <= arr[idx+1]:
        continue
    else:
        print("Desordenado")
        break