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

Envío 6283

Problema 0xcf - Mirando al horizonte

  • Autor: rpedrazacoello
  • Fecha: 2022-05-28 19:00:14 UTC (Hace más de 2 años)
Caso # Resultado Tiempo Memoria
#1
Error de compilación
                      Main.java:18: error: cannot find symbol
            findMaxSuffixArray(0, array);
            ^
  symbol:   method findMaxSuffixArray(int,int[])
  location: class Main
1 error

                    
#2
Error de compilación
                      Main.java:18: error: cannot find symbol
            findMaxSuffixArray(0, array);
            ^
  symbol:   method findMaxSuffixArray(int,int[])
  location: class Main
1 error

                    
#3
Error de compilación
                      Main.java:18: error: cannot find symbol
            findMaxSuffixArray(0, array);
            ^
  symbol:   method findMaxSuffixArray(int,int[])
  location: class Main
1 error

                    
#4
Error de compilación
                      Main.java:18: error: cannot find symbol
            findMaxSuffixArray(0, array);
            ^
  symbol:   method findMaxSuffixArray(int,int[])
  location: class Main
1 error

                    
#5
Error de compilación
                      Main.java:18: error: cannot find symbol
            findMaxSuffixArray(0, array);
            ^
  symbol:   method findMaxSuffixArray(int,int[])
  location: class Main
1 error

                    
#6
Error de compilación
                      Main.java:18: error: cannot find symbol
            findMaxSuffixArray(0, array);
            ^
  symbol:   method findMaxSuffixArray(int,int[])
  location: class Main
1 error

                    
#7
Error de compilación
                      Main.java:18: error: cannot find symbol
            findMaxSuffixArray(0, array);
            ^
  symbol:   method findMaxSuffixArray(int,int[])
  location: class Main
1 error

                    
#8
Error de compilación
                      Main.java:18: error: cannot find symbol
            findMaxSuffixArray(0, array);
            ^
  symbol:   method findMaxSuffixArray(int,int[])
  location: class Main
1 error

                    
#9
Error de compilación
                      Main.java:18: error: cannot find symbol
            findMaxSuffixArray(0, array);
            ^
  symbol:   method findMaxSuffixArray(int,int[])
  location: class Main
1 error

                    
#10
Error de compilación
                      Main.java:18: error: cannot find symbol
            findMaxSuffixArray(0, array);
            ^
  symbol:   method findMaxSuffixArray(int,int[])
  location: class Main
1 error

                    
Puntos totales: 0 / 100

Código

import java.util.HashMap;
import java.util.Scanner;

public class Main {

    private static HashMap<Integer, Integer> memoization = new HashMap<Integer, Integer>();

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int casosDePrueba = scanner.nextInt();
        for(int caso=1; caso<=casosDePrueba; caso++){
            int n = scanner.nextInt();
            int[] array = new int[n];
            for(int i=0; i<n; i++){
                array[i]=scanner.nextInt();
            }

            findMaxSuffixArray(0, array);

            StringBuilder stringBuilder = new StringBuilder();
            stringBuilder.append("Case #" + caso +":");

            for(int i=0; i<n; i++){
                int value = array[i];
                for (int j=i+1; j<=n; j++){
                    if(j == n){
                        stringBuilder.append(" -1");
                    } else {
                        int horizon = array[j];
                        if(horizon > value){
                            stringBuilder.append(" " +horizon);
                            break;
                        }
                    }
                }
            }

            System.out.println(stringBuilder);
        }
    }
}