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

Envío 5780

Problema 0x9d - ¿Está ordenado?

  • Autor: Sugaaron
  • Fecha: 2022-02-28 03:00:09 UTC (Hace casi 3 años)
Caso # Resultado Tiempo Memoria
#1
Error de compilación
                      main.c:1:1: error: unknown type name 'import'
import java.io.*;
^
main.c:1:12: error: expected ';' after top level declarator
import java.io.*;
           ^
           ;
main.c:2:1: error: unknown type name 'import'
import java.util.StringTokenizer;
^
main.c:2:12: error: expected ';' after top level declarator
import java.util.StringTokenizer;
           ^
           ;
main.c:4:1: error: unknown type name 'class'
class Main
^
main.c:4:11: error: expected ';' after top level declarator
class Main
          ^
          ;
6 errors generated.

                    
#2
Error de compilación
                      main.c:1:1: error: unknown type name 'import'
import java.io.*;
^
main.c:1:12: error: expected ';' after top level declarator
import java.io.*;
           ^
           ;
main.c:2:1: error: unknown type name 'import'
import java.util.StringTokenizer;
^
main.c:2:12: error: expected ';' after top level declarator
import java.util.StringTokenizer;
           ^
           ;
main.c:4:1: error: unknown type name 'class'
class Main
^
main.c:4:11: error: expected ';' after top level declarator
class Main
          ^
          ;
6 errors generated.

                    
#3
Error de compilación
                      main.c:1:1: error: unknown type name 'import'
import java.io.*;
^
main.c:1:12: error: expected ';' after top level declarator
import java.io.*;
           ^
           ;
main.c:2:1: error: unknown type name 'import'
import java.util.StringTokenizer;
^
main.c:2:12: error: expected ';' after top level declarator
import java.util.StringTokenizer;
           ^
           ;
main.c:4:1: error: unknown type name 'class'
class Main
^
main.c:4:11: error: expected ';' after top level declarator
class Main
          ^
          ;
6 errors generated.

                    
#4
Error de compilación
                      main.c:1:1: error: unknown type name 'import'
import java.io.*;
^
main.c:1:12: error: expected ';' after top level declarator
import java.io.*;
           ^
           ;
main.c:2:1: error: unknown type name 'import'
import java.util.StringTokenizer;
^
main.c:2:12: error: expected ';' after top level declarator
import java.util.StringTokenizer;
           ^
           ;
main.c:4:1: error: unknown type name 'class'
class Main
^
main.c:4:11: error: expected ';' after top level declarator
class Main
          ^
          ;
6 errors generated.

                    
#5
Error de compilación
                      main.c:1:1: error: unknown type name 'import'
import java.io.*;
^
main.c:1:12: error: expected ';' after top level declarator
import java.io.*;
           ^
           ;
main.c:2:1: error: unknown type name 'import'
import java.util.StringTokenizer;
^
main.c:2:12: error: expected ';' after top level declarator
import java.util.StringTokenizer;
           ^
           ;
main.c:4:1: error: unknown type name 'class'
class Main
^
main.c:4:11: error: expected ';' after top level declarator
class Main
          ^
          ;
6 errors generated.

                    
#6
Error de compilación
                      main.c:1:1: error: unknown type name 'import'
import java.io.*;
^
main.c:1:12: error: expected ';' after top level declarator
import java.io.*;
           ^
           ;
main.c:2:1: error: unknown type name 'import'
import java.util.StringTokenizer;
^
main.c:2:12: error: expected ';' after top level declarator
import java.util.StringTokenizer;
           ^
           ;
main.c:4:1: error: unknown type name 'class'
class Main
^
main.c:4:11: error: expected ';' after top level declarator
class Main
          ^
          ;
6 errors generated.

                    
#7
Error de compilación
                      main.c:1:1: error: unknown type name 'import'
import java.io.*;
^
main.c:1:12: error: expected ';' after top level declarator
import java.io.*;
           ^
           ;
main.c:2:1: error: unknown type name 'import'
import java.util.StringTokenizer;
^
main.c:2:12: error: expected ';' after top level declarator
import java.util.StringTokenizer;
           ^
           ;
main.c:4:1: error: unknown type name 'class'
class Main
^
main.c:4:11: error: expected ';' after top level declarator
class Main
          ^
          ;
6 errors generated.

                    
#8
Error de compilación
                      main.c:1:1: error: unknown type name 'import'
import java.io.*;
^
main.c:1:12: error: expected ';' after top level declarator
import java.io.*;
           ^
           ;
main.c:2:1: error: unknown type name 'import'
import java.util.StringTokenizer;
^
main.c:2:12: error: expected ';' after top level declarator
import java.util.StringTokenizer;
           ^
           ;
main.c:4:1: error: unknown type name 'class'
class Main
^
main.c:4:11: error: expected ';' after top level declarator
class Main
          ^
          ;
6 errors generated.

                    
#9
Error de compilación
                      main.c:1:1: error: unknown type name 'import'
import java.io.*;
^
main.c:1:12: error: expected ';' after top level declarator
import java.io.*;
           ^
           ;
main.c:2:1: error: unknown type name 'import'
import java.util.StringTokenizer;
^
main.c:2:12: error: expected ';' after top level declarator
import java.util.StringTokenizer;
           ^
           ;
main.c:4:1: error: unknown type name 'class'
class Main
^
main.c:4:11: error: expected ';' after top level declarator
class Main
          ^
          ;
6 errors generated.

                    
#10
Error de compilación
                      main.c:1:1: error: unknown type name 'import'
import java.io.*;
^
main.c:1:12: error: expected ';' after top level declarator
import java.io.*;
           ^
           ;
main.c:2:1: error: unknown type name 'import'
import java.util.StringTokenizer;
^
main.c:2:12: error: expected ';' after top level declarator
import java.util.StringTokenizer;
           ^
           ;
main.c:4:1: error: unknown type name 'class'
class Main
^
main.c:4:11: error: expected ';' after top level declarator
class Main
          ^
          ;
6 errors generated.

                    
#11
Error de compilación
                      main.c:1:1: error: unknown type name 'import'
import java.io.*;
^
main.c:1:12: error: expected ';' after top level declarator
import java.io.*;
           ^
           ;
main.c:2:1: error: unknown type name 'import'
import java.util.StringTokenizer;
^
main.c:2:12: error: expected ';' after top level declarator
import java.util.StringTokenizer;
           ^
           ;
main.c:4:1: error: unknown type name 'class'
class Main
^
main.c:4:11: error: expected ';' after top level declarator
class Main
          ^
          ;
6 errors generated.

                    
#12
Error de compilación
                      main.c:1:1: error: unknown type name 'import'
import java.io.*;
^
main.c:1:12: error: expected ';' after top level declarator
import java.io.*;
           ^
           ;
main.c:2:1: error: unknown type name 'import'
import java.util.StringTokenizer;
^
main.c:2:12: error: expected ';' after top level declarator
import java.util.StringTokenizer;
           ^
           ;
main.c:4:1: error: unknown type name 'class'
class Main
^
main.c:4:11: error: expected ';' after top level declarator
class Main
          ^
          ;
6 errors generated.

                    
Puntos totales: 0 / 100

Código

import java.io.*;
import java.util.StringTokenizer;

class Main
{
    public static void main(String[] args) throws IOException{
        
        int mayor = Integer.MIN_VALUE;
        int contador = 0;
        
        BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(bf.readLine());
        int cantidad = Integer.parseInt(st.nextToken());

        while(st.hasMoreTokens()){
            int valor = Integer.parseInt(st.nextToken());
            if(valor>mayor){
                mayor=valor;
                contador++;
            }
        }
        if(contador==cantidad){
            System.out.println("Ordenado");
        }else{
            System.out.println("Desordenado");
        }
    }
}